Uppdated: now with errorhandling.
<*>Uses a keyfile with random insted of password algoritm, this makes the keyfile uniqe and should make it pretty damn hard to decrypt.
<*>Supports encryption and decryption, iwe tried images and executables and they where all working after en-to-de-crypt.
<*>Error handling added, my first version did not contain errohandling making it somewhat hard to use. Returining both a message and Seterror, if error should appear.
<*>Works fairly fast, a file 10kb takes about 520ms to encrypt and decrypt.
Example: (to make example work create a test file with some text inn it.)
#include <crypt.au3> $keyfile = 'Crypt.key' $innfile = 'test.txt' $encrypted = 'encrypted.txt' $decrypted = 'decrypted.txt' If FileExists($keyfile) = 0 Then ConsoleWrite('Key file not found. Creating '&$keyfile & @CRLF) _CryptKeyGen($keyfile) EndIf ConsoleWrite('File encrypted inn '&_Crypt($keyfile,1,$innfile,$encrypted)&' ms.' & @CRLF) ConsoleWrite('File decrypted inn '&_Crypt($keyfile,0,$encrypted,$decrypted)&' ms.' & @CRLF)
Edited by jokke, 02 June 2007 - 10:56 AM.