Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to encrypt/decrypt data?

Posted on 2002-07-27
4
Medium Priority
?
376 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 400 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

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

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

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…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

688 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