Solved

How to encrypt/decrypt data?

Posted on 2002-07-27
4
369 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
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

Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Web server load balancing technologies and methods 3 96
wordpress limitations 4 123
Ways to assess https/ssl websites 3 102
Setting Up Local Lan Web Server 1 64
One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

809 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