Advertisement

07.05.2007 at 09:25AM PDT, ID: 22677216
[x]
Attachment Details

Function to encrypt/decrypt a string

Asked by JagC in Active Server Pages (ASP)

Tags: decrypt, function, encrypt, string

Hi all

Overview
In a web app that I am developing I need to email the user a piece of info. After logging on to the system they will enter this piece of info and it will use this, as well as other bits of info from the database.

This string though needs to be encrypted. It is not for security reasons as such, just to obfuscate the actual string value. It is not a database key, an ID or anything like that. Just a simple string that we do not store but instead send to the client. (Unfortunately I am not allowed to provide any more information on this :(

Once they have logged on and entered the string, it will be decrypted and displayed on the screen. As a result, the function (or two) needs to be two way.

Requirements:
1. Encrypt a short character string consisting of characters, numbers and spaces (max leng about 5).
2. The encrypted string should be of fixed length (of about 8 characters)
3. The decryption function should take this encrypted string and convert it back exactly.
4. Must not require any kind of server side install (I have access to the server but do not trust 'unknown' components and there is no budget for it as it's not mission critical).

I've tried:
Standard ROT13 functions
these only work with characters and the length is the same as the original string - so no good

MD5 Hashing
A project I worked on years ago had a MD5 hash and unhash function (I know MD% is one way, but this one wasn't :). There are  a few sites that can MD5 hash a string and unhash it - but I can't find anything like this that actually displays the code. (I have an MD5 hashing function but not one to unhash it)

Various other code snippets
I've been googling this for hours, sorting through code trying to find something suitable. But no joy.

To re-iterate. The function(s) does not need to be massively complex - just enough to obfuscate the string and return a fixed length string that can then be decrypted.

I don't have the time to do it myself or I would :) Even though I just spent hours trying to find one :(Start Free Trial
[+][-]07.05.2007 at 09:39AM PDT, ID: 19425361

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Active Server Pages (ASP)
Tags: decrypt, function, encrypt, string
Sign Up Now!
Solution Provided By: effx
Participating Experts: 4
Solution Grade: A
 
 
[+][-]07.05.2007 at 09:41AM PDT, ID: 19425379

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.05.2007 at 09:42AM PDT, ID: 19425386

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.05.2007 at 09:47AM PDT, ID: 19425421

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.05.2007 at 09:49AM PDT, ID: 19425436

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.05.2007 at 10:12AM PDT, ID: 19425597

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.05.2007 at 01:52PM PDT, ID: 19427228

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.05.2007 at 01:53PM PDT, ID: 19427236

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.05.2007 at 06:40PM PDT, ID: 19429048

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.06.2007 at 12:25AM PDT, ID: 19430042

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.06.2007 at 01:12AM PDT, ID: 19430178

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.06.2007 at 03:28AM PDT, ID: 19430602

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32