These should both answer "true" at the end, but the first, using "key" doesn't. I've encountered it while encrypting and decrypting binary files, expecting to reproduce the files exactly.
on mouseUp answer file "Choose a file" put it into fPath open file fPath for binary read read from file fPath until end put it into originalData close file fPath repeat 32 times put numToChar(random(255)) after tKey end repeat encrypt originalData using "aes256" with key tKey at 256 bit put it into encryptedData decrypt encryptedData using "aes256" with key tKey at 256 bit put it into restoredData answer restoredData=originalData #### answers false end mouseUp
on mouseUp
answer file "Choose a file"
put it into fPath
open file fPath for binary read
read from file fPath until end
put it into originalData
close file fPath
repeat 32 times
put numToChar(random(255)) after tKey
end repeat
encrypt originalData using "aes256" with password tKey at 256 bit
put it into encryptedData
decrypt encryptedData using "aes256" with password tKey at 256 bit
put it into restoredData
answer restoredData=originalData #### answers true
end mouseUpEven though it seems that a binary key works as the password I'd like to know if passwords are supposed to be restricted to certain chars and if the second script is less secure than the first, if it worked.
Thanks for any help
_______________________________________________ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
