Board index » delphi » Simple Encryption

Simple Encryption


2007-06-15 12:23:17 AM
delphi42
I am looking for a component or .pas file that would allow me to encrypt a
password for storing in a file so the encryption should be quite strong. Is
there an easy to use or a solution that you can recommend for encrypting a
string?
Doug
 
 

Re:Simple Encryption

There's always TurboPower's LockBox. it is free on
SourceForge at sourceforge.net/projects/tplockbox/.
-- Larry Maturo
"Doug Olson" <XXXX@XXXXX.COM>writes
Quote
I am looking for a component or .pas file that would allow me to encrypt a
password for storing in a file so the encryption should be quite strong.
Is there an easy to use or a solution that you can recommend for encrypting
a string?

Doug


 

Re:Simple Encryption

Doug Olson writes:
Quote
I am looking for a component or .pas file that would allow me to encrypt a
password for storing in a file so the encryption should be quite strong. Is
there an easy to use or a solution that you can recommend for encrypting a
string?
You can use the CryptProtectData API function which can piggy back off
of Windows login security (Google "DPAPI" for more info):
msdn2.microsoft.com/en-US/library/aa380261.aspx
The headers have been translated in the JCL: JwaWinCrypt.pas
Or you can use an encryption library like:
www.cityinthesky.co.uk/cryptography.html
But I believe you will need some kind of password to encrypt the original
password. Where will that be stored? :)
--
Brian Moelk
Brain Endeavor LLC
XXXX@XXXXX.COM
 

Re:Simple Encryption

Doug Olson writes:
Quote
I am looking for a component or .pas file that would allow me to encrypt a
password for storing in a file so the encryption should be quite strong. Is
there an easy to use or a solution that you can recommend for encrypting a
string?
Take a look here: docs.streamsec.net/Page.aspx
As Brian Moelk pointed out, the problem isn't trivial if you want to
store the password with confidentiality, because (symmetric) encryption
requires a key that also has to be kept confidential. You will easily
end up with an infinite regress unless you rethink the problem itself.
 

Re:Simple Encryption

Ah, you bring up great points on what I was trying to achieve... Version 1
they will need to key in the password :)
Thanks for the links though, I will be reviewing the best option for this...
Doug
"Doug Olson" <XXXX@XXXXX.COM>writes
Quote
I am looking for a component or .pas file that would allow me to encrypt a
password for storing in a file so the encryption should be quite strong.
Is there an easy to use or a solution that you can recommend for encrypting
a string?

Doug


 

Re:Simple Encryption

Doug Olson schreef:
Quote
I am looking for a component or .pas file that would allow me to encrypt a
password for storing in a file so the encryption should be quite strong. Is
there an easy to use or a solution that you can recommend for encrypting a
string?
You usually wouldn't want to store a password, encrypted or not, because
you would have to worry about protecting the encryption key.
You normally would prefer to store a (SHA1) hash of the password and
compare that hash to the hash of the password entered by the user.
Easy, simple, quite foolproof.
The DPCrypt library by David Barton (www.cityinthesky.co.uk/) has
all you need for this (working and tested pascal source code).
Danny
---
 

Re:Simple Encryption