Hi Billy,

I have found that encrypt can create some values that
the database will choke on.  You may need to enlist
the help of base64 encoding.  You're going to need to
use the functions tostring(),tobinary(), and
tobase64() for your encryption/decryption process.

For instance, to encrypt a customer's "secret word"
you'd do SOMETHING LIKE (this is probably close, but
might not quite work right off the bat):

<CFSET
secret_word_encrypted=#ToBase64(encrypt("#customer_secret_word#","#customer_last_name#1234"))#>

Then to decrypt:

<cfset
thevalue="#tostring(tobinary("#secret_word_encrypted"))#">
<CFOUTPUT>#decrypt("#thevalue#","#customer_last_name#1234")#</CFOUTPUT>

HTH,

Eron




-----Original Message-----
From: Billy Cravens [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 03, 2000 2:58 PM
To: CF-Talk
Subject: Decrypt()


I'm trying to run a routine to decrypt a record in a
table.  All records
were encrypted using Encrypt(), with a routine
encryption key:
<cfset EncryptedText = Encrypt(String,EncryptionKey)>



However, some of the encrypted passwords cause this
error to appear:

---BEGIN ERROR---
An unexpected system error was detected. (Error code
is 20)

This type of error will most likely occur when the
server running
ColdFusion is low on memory and/or system resources.
---END ERROR---

The code I'm using is below:

<cfquery name="GetEncryptionKey" datasource="dsn"
dbtype="ODBC">
select encryptionKey, encryptedText
from table
</cfquery>

<cfoutput query="GetEncryptionKey">

        <cfset DecryptedSting =
Decrypt(encryptedText,encryptionKey)>

</cfoutput>




I've checked the resources on the server; they're OK.

I prefer to use cfusion_encrypt and cfusion_decrypt;
however, that's not
an option here, as I do not have any control over the
encryption
process.

Ideas?


-- 
Billy Cravens
[EMAIL PROTECTED]
------------------------------------------------------------------------------------------------
Archives:
http://www.mail-archive.com/[email protected]/
Unsubscribe:
http://www.houseoffusion.com/index.cfm?sidebar=lists
or send a message with 'unsubscribe' in the body to [EMAIL PROTECTED]

__________________________________________________
Do You Yahoo!?
>From homework help to love advice, Yahoo! Experts has your answer.
http://experts.yahoo.com/
------------------------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message 
with 'unsubscribe' in the body to [EMAIL PROTECTED]

Reply via email to