continyu Posted October 11, 2010 Share Posted October 11, 2010 I'm working on my little script which is dedicated to crypt/decrytp files. (i know there are other but i just want to improve myself with challenges...) So i've handled other things so far i got one problem, When i crypted a file with my script (using crytp.au3 functions- thx for that!) also i'm changing its extension to -lets say- ".crypt" so when i wantto decrypt this file i would like to change it's extension to what it was before... Is there anyway to recognize files' extension with autoit, or can i add some data to my new ".crypt" extensioned file it's original extension. and then read it when i'm decrypting it... Waiting for your answers.. thank you.. (my english is bad i know, and i'm sory.) Link to comment Share on other sites More sharing options...
autoitter Posted October 11, 2010 Share Posted October 11, 2010 Just add the .crypt extension after the original extension. For example: document.doc.crypt. Strip the .crypt of when decrypting and your done. Link to comment Share on other sites More sharing options...
DarkAngel Posted October 11, 2010 Share Posted October 11, 2010 #Include <Crypt.au3> $sPassword = "DarkAngel" $sSourceFile = "Filename.Ext" $sCryptFile = $sSourceFile & ".drk" $sDecryptFile = StringReplace($sCryptFile, ".drk", "") _Crypt_EncryptFile($sSourceFile, $sCryptFile, $sPassword, $CALG_DES) FileDelete($sSourceFile) MsgBox(0, "Check", "See if source has gone") _Crypt_DecryptFile($sCryptFile, $sDecryptFile, $sPassword, $CALG_DES) MsgBox(0, "Check", "See if the source is back again!") Hope this helps .. Link to comment Share on other sites More sharing options...
continyu Posted October 11, 2010 Author Share Posted October 11, 2010 Thank both of you for your answers. Example and idea should work. BUT i don't know if i'm asking for too much but in this way file's original extension is obvious and script will create disturbing filenames like filename.avi.crypt etc. So is there anyone know do that hidden. Or i will just use replace method... Link to comment Share on other sites More sharing options...
DarkAngel Posted October 11, 2010 Share Posted October 11, 2010 change windows setting to hide known file types .. In this case use ur extension as the hidden one . The original extension is considered as a part of the file name . Link to comment Share on other sites More sharing options...
continyu Posted October 11, 2010 Author Share Posted October 11, 2010 still wont work with all computers. I'm thinking of adding resources as text in those files but don't have any idea to do that ... Link to comment Share on other sites More sharing options...
jvanegmond Posted October 11, 2010 Share Posted October 11, 2010 still wont work with all computers. I'm thinking of adding resources as text in those files but don't have any idea to do that ...Say you have a file called hello.txt containing text "Hello world". You can put the extension before the text "Hello World" and encrypt it like that. So you get ".txt|Hello World" and encrypt it into "asjkd896ad58asd" (random). You store the encrypted file as hello.crypt, once you decrypt and see the result ".txt|Hello World" you can remove the ".txt|" part and rename the file back to hello.txt. github.com/jvanegmond 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