Hi all,
Does anyone have a routine with example to encrypt/decrypt text files?
Thanks in avance
Fabrício F. Kammer

Mailing lists / fpc-pascal / 2006-08
9 messages · 4 people · –
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
Hi all,
Does anyone have a routine with example to encrypt/decrypt text files?
Thanks in avance
Fabrício F. Kammer
There are two hash in: fpcsrc/packages/base/hash
There is, for example, Blowfish (a ciphers for actual encryption/decryption) in: fpcsrc/fcl/incblowfish.pp
Blowfish is very good by the way (as is fast). There are many others; I also saw a a kit of many ciphers in Delphi which could certainly work on FPC. See
http://www.efg2.com/Lab/Library/Delphi/MathFunctions/Cryptography.htm for many of them.
I used that one http://www.cityinthesky.co.uk/cryptography.html in a project once, but it was under Delphi. It should work under FPC I think... It's up to you to try.
Regards.
It has been ported to fpc/lazarus:
http://wiki.lazarus.freepascal.org/index.php/DCPcrypt
Vincent
Thanks Alexandre and Vincent but I need of a bit more help with this.
I'm working in a software to protect my main software. Look how I want to make:
- This software will be a TCP Server (I'm calling it of Authentication software).
- This software must run in the console, then I can't have graphical application for it. I want to make this software runs az daemon on the future.
- I'll have some informations of the server (hardware information that I get on /proc) and the number of stations that can use my main software together storaged in a crypted file.
- I need to read this crypted file, decrypt it and compare with the informations of /proc again. Then I need of a form to encrypt/decrypt the file to compare with the actual information.
If I use md5 I can't decrypt the text. In yours opnion what's the indicate algorithm do make this?
Thanks again
Fabrício F. Kammer
Conchal/SP/Brazil
2006/8/25, "Fabrício F. Kammer" :
If I use md5 I can't decrypt the text. In yours opnion what's the indicate algorithm do make this?
Hi Fabrício,
Exact, (as stated in my first email) all "hash" algo like md5 can't be decoded. These are... hash! All "cipher" algo like blowfish/twofish, etc. can be encoded, stored, and later decoded provided you have the key.
Any cipher algo will serve your needs. Since DCPCrypt has been ported (thank you Vincent, I did not know), all cipher (in DCPciphers tab) will do what you need. Pick the one(s) that fit your needs.
See http://wiki.lazarus.freepascal.org/index.php/DCPcrypt as given by Vincent.
Best regards.
Thanks Alexandre,
I'll see it.
Regards
Fabrício
Alexandre,
Do you know how can I use the DCP just in freepascal for prompt compilation?
I'm not using Lazarus.
Thanks again
Alexandre,
I could use the DCP on fpc... I compiled all units.
Thanks
Fabrício
Does anyone have a routine with example to encrypt/decrypt text files? Thanks in avance…
Hello!
You ("Fabricio F. Kammer" )
wrote about "[fpc-pascal] encryption" on 08/25/2006 at 17:56:
"F> Does anyone have a routine with example to encrypt/decrypt text files?
What exactly do you want to achieve by encryption? Security implemented wrong is worse than no (http://www.eldos.com/sbb/) is available for FPC btw
Sincerely yours,
Eugene Mayevski