Solved

How to encrypt/decrypt data?

Posted on 2002-07-27
4
373 Views
Last Modified: 2013-12-24
Hi,

I have a webpage written in Coldfusion and would like user to submit info (Registration type). How can I enrypt the data when adding the record to Access and decrypt it when user needs to view it? My database is reside at someone's server and I do not want the Admin to view anything.

Other Questions:
1. Anyway to encrypt data already in Access?
2. Any other easier ways to do it, for lazy person like me? (Example: Just encrypt the whole database rather than do it for each data entry)
3. And lastly, where to encrypt the data? Part of my registration page is as below. Modify my code will be very helpful.

<tr><td>Company*</td>
<td><input name="name" size="30"></td></tr>

<tr><td>Login Name*</td>
<td><input class=textfield type=text name="loginname" size="30"></td></tr>

<tr><td>Address 1*</td>
<td><input name="address1" size="30"></td></tr>

<tr><td>Address 2</td>
<td><input name="address2" size="30"></td></tr>

Thanks.
0
Comment
Question by:buybuy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 11

Accepted Solution

by:
jimmy282 earned 100 total points
ID: 7183180
You can use the Inbuilt Coldfusion Functions.
Encrypt() and Decrypt()

Have a look at this example.

<!--- This example shows the use of Encrypt and Decrypt --->
<html>
<head>
<title>Encrypt Example</title>
</head>

<body bgcolor = silver>
<H3>Encrypt Example</H3>

<P>This function allows for the encryption and decryption of a
string. Try it out by entering your own string and a key of your
own choosing and seeing the results.
<cfif IsDefined("FORM.myString")>
  <cfset string = FORM.myString>
  <cfset key = FORM.myKey>
  <cfset encrypted = encrypt(string, key)>
  <cfset decrypted = decrypt(encrypted, key)>
  <cfoutput>
   <H4><B>The string:</B></H4> #string# <BR>
   <H4><B>The key:</B></H4> #key#<BR>
   <H4><B>Encrypted:</B></H4> #encrypted#<BR>
   <H4><B>Decrypted:</B></H4> #decrypted#<BR>
  </cfoutput>
</cfif>
<form action = "encrypt.cfm" method = "post">
<P>Input your key:
<P><input type = "Text" name = "myKey" value = "foobar">
<P>Input your string to be encrypted:
<P><textArea name = "myString" cols = "40" rows = "5" WRAP = "VIRTUAL">
This string will be encrypted (try typing some more)
</textArea>
<input type = "Submit" value = "Encrypt my String">
</FORM>
</body>
</html>    



You encrypt it before you enter the record into database and decrypt it when you fetch from database.

Hope it helps.

Jimmy
0
 
LVL 17

Expert Comment

by:anandkp
ID: 7184443
HI there,

Jimmy is perfectly right abt this -

but make sure u set ur key value to something like "buybuy_or_whatever_u_want"

& use the same key value while encrypting & decrypting ur values.

keep in mind that if at ne-point u change ur key value - u cannot decrypt teh earlier encrypted values, using the new key.

so the value of key - has to remain a constant - througout !!!

K'Rgds
Anand
0
 

Author Comment

by:buybuy
ID: 7186843
Thanks guys for your help. :)
0
 

Expert Comment

by:mistergin
ID: 13055054
I heard that the native encryption techniques were less than ideal, any news on their status in MX?

I've had several friends use other custom methods instead because of this...
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…

615 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question