Sign in to follow this  
Followers 0
masvil

_StringEncrypt problem

3 posts in this topic

$file = FileOpen("test.txt", 1)

$enc = _StringEncrypt(1, "Line1", $pw)
FileWrite($file, $enc)
$enc = _StringEncrypt(1, "Still Line1" & @CRLF, $pw)
FileWrite($file, $enc)
$enc = _StringEncrypt(1, "Line2", $pw)
FileWrite($file, $enc)

FileClose($file)

How can I get I decrypt test.txt?

This doesn't work:

$file = FileOpen("test.txt", 0)
While 1
   $line = FileReadLine($file)
   If @error = -1 Then ExitLoop
   $file2 = FileOpen("test2.txt", 1)
   $dec = _StringEncrypt(0, $line, $pw)
   FileWriteLine($file2, $dec)
   FileClose($file2)
WEnd
FileClose($file)

Share this post


Link to post
Share on other sites



You will have to decrypt the same length as you encrypted.......

Why not write each encrypted string on a seperate line ?


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

OK, I've replaced FileWrite with FileWriteLine and it works :lmao:

Thanx

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0