nend Posted August 18, 2016 Share Posted August 18, 2016 (edited) Is it posible to encrypt a txt file and open it in a other program to only read it to string without saving it first. Everyting I tryd won't give me the data in the console. #include <Crypt.au3> $import_file = FileOpenDialog("Encrypt file", "", "TEXT (*.txt)") If $import_file <> "" Then $dir = StringTrimRight($import_file, StringLen($import_file) - StringInStr($import_file, "\", 0, -1)) $name = StringReplace(StringTrimLeft($import_file, StringInStr($import_file, "\", 0, -1)), ".txt", "") _Crypt_EncryptFile($import_file, $dir & "/" & $name & ".trs", "BLA", $CALG_AES_128) EndIf $file_handle = FileOpen($dir & "/" & $name & ".trs", 0) $file_to_string = FileRead($file_handle) $return_string = _Crypt_DecryptData($file_to_string, "Bla", $CALG_AES_128) FileClose($file_handle) ConsoleWrite(BinaryToString($return_string) & @CRLF) Thanks! Edited August 18, 2016 by nend Link to comment Share on other sites More sharing options...
nend Posted August 18, 2016 Author Share Posted August 18, 2016 Ok I've I all ready solved it. I've used _Crypt_EncryptData -> output to a file and than it will work. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now