[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 223
  • Last Modified:

encryption n decryption of data

Hi
I have a programme written in Visual Basic and back end it uses
MS Access. i want to encrypted the data.
when i insert the data it should be encrypted/encoded and when i retrieve it, it should be
decrypted/decoded.
Can some one suggest how to do it.

Thanks

0
Gawai
Asked:
Gawai
1 Solution
 
JacamarCommented:
Just be creative.  Create a good system for you encryption.  I always have more fun when I make up a new encryption for my codess.
0
 
GawaiAuthor Commented:
will u give some code just as a sample or give me some idea
thanks
0
 
Arthur_WoodCommented:
a very simple approach is to use what is known as XOR encryption:

define a suitable KEY string, of a suitable length (say 50 characters)  and then character by character you ENCRYPT the original string like this:

    strKey = "[SomeSuitableKeyStringOfCharcaters]"
    For iChar = 1 To Len(OriginalString)
        strTemp = strTemp & Chr$(Asc(Mid$(OriginalString, iChar, 1)) Xor Asc(Mid$(strKey, iChar, 1)))
    Next


here strTemp is the ENCRYPTED string

Amazingly enough, you DECRYPT the string in EXCATLY the same way, XOR with the SAME Key String!!!


As I said, this is VERY simple, and is designed to work with strings.  If you need to encrypt NUMBERS, then taht is another issue.

AW
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
JacamarCommented:
http://www.visualbasicforum.com/t31778.html

Check out this site.  It has some good basic examples.
0
 
CyrexCore2kCommented:
Zarr made a nice RC4 encryption module.
http://www.zarr.net/vb/download/codedetail.asp?code=46


To use it add the RC4.bas file to your project. Then make a global variable and call it EKEY give EKEY some random value of any length by just kinda pounding on the keyboard ;)

To encrypt data:

MyEncryptedData = RC4("Hello to the world!", EKEY)

To decrypt it:

MyDecryptedData = RC4(MyEncryptedData, EKEY)

Hope this helps
Spencer Ruport

0
 
CleanupPingCommented:
Hi gawai,
This old question (QID 20557509) needs to be finalized -- accept an answer, split points, or get a refund.  Please see http://www.cityofangels.com/Experts/Closing.htm for information and options.
0
 
GPrentice00Commented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

-->Accept Arthur_Wood's comments as answer

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

GPrentice00
EE Cleanup Volunteer
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now