Encrypt password
-
Hello all, Does anyone of you know of a simple class to encrypt my password before I write it to a file? And of course decrypt it again so I can use it ;) I had a look at the 2 articles in system/cryptography, but they don't fit my needs. I also looked at an app using crypto++[^], but that seemed like a bit of overkill too. So basically I'm looking for a simple class that encrypts/decrypts my password using whatever algorithm (MD5, PKI, ...). Or any pointers how I can start my own class. tia Wim
-
Hello all, Does anyone of you know of a simple class to encrypt my password before I write it to a file? And of course decrypt it again so I can use it ;) I had a look at the 2 articles in system/cryptography, but they don't fit my needs. I also looked at an app using crypto++[^], but that seemed like a bit of overkill too. So basically I'm looking for a simple class that encrypts/decrypts my password using whatever algorithm (MD5, PKI, ...). Or any pointers how I can start my own class. tia Wim
Wim Jans wrote: Does anyone of you know of a simple class to encrypt my password before I write it to a file? And of course decrypt it again so I can use it Cryptography isn't simple. Period. If you had a look at some real cryptography but you deemed it "a bit of overkill", perhaps what you want isn't anything cryptographically safe? What about xor'ing the password with some known value and the just hash it? Maybe even a plain SHA or even a CRC32 could be fine...
-
Wim Jans wrote: Does anyone of you know of a simple class to encrypt my password before I write it to a file? And of course decrypt it again so I can use it Cryptography isn't simple. Period. If you had a look at some real cryptography but you deemed it "a bit of overkill", perhaps what you want isn't anything cryptographically safe? What about xor'ing the password with some known value and the just hash it? Maybe even a plain SHA or even a CRC32 could be fine...
Hi Mike, Thanks for the answer. I will have a look at the CRC32 or SHA stuff. With 'a bit of overkill' I meant that they offer a wealth of encryption algorithms in one library, while I just needed one. So it would be nice of one had a class with only eg. a MD5 algorithm in it. Thanks again Wim
-
Hi Mike, Thanks for the answer. I will have a look at the CRC32 or SHA stuff. With 'a bit of overkill' I meant that they offer a wealth of encryption algorithms in one library, while I just needed one. So it would be nice of one had a class with only eg. a MD5 algorithm in it. Thanks again Wim
If you want to decrypt your password again, you can't use SHA (Secure Hash Algorithm) or MD5 (Message Digest 5) because they are hashing-algorithms. Hashing algorithms are one-way-functions. That means that one direction is (very) easy to do ("encrypt") but the other ("decrypt") is nealy impossible. Look up for a definition of hashing algorithms in the internet and you wil see you can't use them. What you want is an encryption/decryption algorithm like RSA, DES, AES and so on. Some of them are built in to the CryptoAPI integrated in Windows. -- karl
-
Hello all, Does anyone of you know of a simple class to encrypt my password before I write it to a file? And of course decrypt it again so I can use it ;) I had a look at the 2 articles in system/cryptography, but they don't fit my needs. I also looked at an app using crypto++[^], but that seemed like a bit of overkill too. So basically I'm looking for a simple class that encrypts/decrypts my password using whatever algorithm (MD5, PKI, ...). Or any pointers how I can start my own class. tia Wim
Search your MSDN Library! There is good examples there in how you encrypt/decrypt. Rickard Andersson@Suza Computing C# and C++ programmer from SWEDEN! UIN: 50302279 E-Mail: nikado@pc.nu Speciality: I love C#, ASP.NET and C++!