Click here to Skip to main content
15,887,886 members
Articles / Desktop Programming / MFC
Article

ARACrypt - a crypto class

Rate me:
Please Sign up or sign in to vote.
4.50/5 (10 votes)
24 May 2002 135.6K   1.9K   32   25
Extremely simple crypto class

Introduction

This is an extremely simple class for encrypting/decrypting text. This cannot get any simpler. All you have to do is create an instance of the ARACrypt class and call TransformString passing it first the encryption/decryption key, then the CString holding your text you want to en/decrypt.

You should have any problems running this. It isn't my code though. It was written by Kurtz. I just could pass on sharing it with you.

ARACrypt Crypt;
CSTring Key = "MyKey";
CString sSecretString = "My info";

Crypt.TransformString( Key, sSecretString);

To get the string decrypted just make the call to TransformString again. It is that simple

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
QuestionVC6 - Works Well Except for Memory Leaks Pin
fwcetus27-Feb-13 11:14
fwcetus27-Feb-13 11:14 
Questionthanks Pin
gknows13-Dec-12 22:52
gknows13-Dec-12 22:52 
GeneralPLEASE READ FIRST BEFORE POSTING Pin
DarrollWalsh31-Jul-08 9:03
DarrollWalsh31-Jul-08 9:03 
Generalpleaseeee help me Pin
aganaye24-Sep-07 23:31
aganaye24-Sep-07 23:31 
NewsRe: pleaseeee help me Pin
DarrollWalsh31-Jul-08 8:58
DarrollWalsh31-Jul-08 8:58 
General.NET Pin
tsotso13-Nov-06 3:28
tsotso13-Nov-06 3:28 
GeneralRe: .NET Pin
DarrollWalsh31-Jul-08 9:00
DarrollWalsh31-Jul-08 9:00 
GeneralDelphi translation Pin
esegura13-Jan-04 8:41
esegura13-Jan-04 8:41 
QuestionHelp me please?? Pin
xxhimanshu4-Nov-03 23:11
xxhimanshu4-Nov-03 23:11 
GeneralSomething wrong with my test program Pin
jargine21-Oct-03 16:29
jargine21-Oct-03 16:29 
GeneralRe: Something wrong with my test program Pin
14-Aug-05 10:43
suss14-Aug-05 10:43 
GeneralProblem Pin
Arsalan Minhas12-Aug-03 0:24
Arsalan Minhas12-Aug-03 0:24 
No doubt this code is simplest & easiest to use. But I am facing one problem. I have an application A (in which _UNICODE is defined) which encrypts some text & stores the encrypted text in the registry. Later if I try to read the encrypted text from the registry, decrypt it using the same application A, I face no problem. But if I read it through another application B (which is not using _UNICODE) it gives some invalid text after decryption. Similiarly if application B encrypts some text & I try to decrypt it by using application A it also returns some invalid string. What should I do? Frown | :( I have to use both the applications A (with unicode support) & B (without unicode support) however the text is simple CString (e.g. abc123 i.e. alphanumeric characters). Do I have to perform some unicode conversion on the string or anything else?

I will appreciate your urgent response. Thanks.
GeneralVery nice Pin
Koszyk18-Dec-02 3:03
Koszyk18-Dec-02 3:03 
Questionusage? Pin
bryce15-Jul-02 21:20
bryce15-Jul-02 21:20 
AnswerRe: usage? Pin
Anonymous28-Jul-02 17:32
Anonymous28-Jul-02 17:32 
GeneralGood,a little question Pin
dicker27-May-02 23:58
dicker27-May-02 23:58 
GeneralRe: Good,a little question Pin
DarrollWalsh28-May-02 1:06
DarrollWalsh28-May-02 1:06 
Generalanother class on CodeProject... Pin
Andreas Saurwein26-May-02 22:45
Andreas Saurwein26-May-02 22:45 
GeneralRe: another class on CodeProject... Pin
DarrollWalsh27-May-02 12:26
DarrollWalsh27-May-02 12:26 
GeneralCool! Pin
jack Mesic25-May-02 17:38
jack Mesic25-May-02 17:38 
GeneralHmm Pin
Jörgen Sigvardsson25-May-02 1:41
Jörgen Sigvardsson25-May-02 1:41 
GeneralRe: Hmm Pin
DarrollWalsh25-May-02 2:20
DarrollWalsh25-May-02 2:20 
GeneralRe: Hmm Pin
DanPetitt28-May-02 9:49
DanPetitt28-May-02 9:49 
GeneralRe: Hmm Pin
Koszyk20-Dec-02 3:03
Koszyk20-Dec-02 3:03 
GeneralAnother example at CodeProject Pin
Dan Madden25-May-02 1:11
Dan Madden25-May-02 1:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.