Jump to content

Fast Crypt


jpam
 Share

Recommended Posts

Doh! I almost wanted to write: "Gimme da source of that DLL or I won't run it"...but, for god's sake, I haven't (or at least nobody has noticed?) :)

...However, I (re)phrase and ask for one (1) single time: Would it be possible to get the source code of the DLL you provided within your zip-file?

Regards,

Chris

Edited by cherdeg
Link to comment
Share on other sites

  • Replies 47
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Doh! I almost wanted to write: "Gimme da source of that DLL or I won't run it"...but, for god's sake, I haven't (or at least nobody has noticed?) :)

...However, I (re)phrase and ask for one (1) single time: Would it be possible to get the source code of the DLL you provided within your zip-file?

Regards,

Chris

Unless you know assembly it will look like utter gibberish to you. With a bunch of 3 letter acronyms, and a bunch of addresses.

Link to comment
Share on other sites

rewrote xor routine in dll

tested on vista(friend) without problems.

AlienWare can you test it on your computer ?

with this version only password strings are allowed,

if there are no problems on your computer then i add Keyfile support

http://prospeed-jan.xprofan.com/list-all-downloads.php

Woot Woot!! I was waiting for a PM! Just saw this thread again so, YES! It works like a charm! Thank you jpam, this is now my Encryptor of choice!
Link to comment
Share on other sites

Also, it fails to encrypt FreeText.au3, UDF by Valuater.

Problem signature:

Problem Event Name: APPCRASH

Application Name: AutoIt3.exe

Application Version: 3.2.13.7

Application Timestamp: 48997e0f

Fault Module Name: crypt.dll

Fault Module Version: 0.0.0.0

Fault Module Timestamp: 48da48a3

Exception Code: c0000005

Exception Offset: 0000125c

OS Version: 6.0.6001.2.1.0.768.3

Locale ID: 1033

Additional Information 1: 14f5

Additional Information 2: ce5f2ec6abc2552aebbd20021f29de12

Additional Information 3: d7b8

Additional Information 4: 2f6381e6a426247bf4f79e4c000d93d6

Read our privacy statement:

http://go.microsoft.com/fwlink/?linkid=501...mp;clcid=0x0409

EDIT: It appears it's not the file, because I deleted it, and the file after it, failed like that. Maybe after some number, of continous calls, it will fail? I'm tring to encrypt my whole E:\ drive. Heres my code.

#include "Crypt.au3"
#include <Array.au3>
$fArray = _FileListToArrayEx("E:\", "*", 1, "", True)
_ArrayDisplay($fArray)
_Crypt_Init(@ScriptDir&"\crypt.dll")
$init = TimerInit()
For $i=1 To $fArray[0]
    _Crypt_CryptFile($fArray[$i], "123")
    TrayTip("", $fArray[$i], 2)
    Sleep(50)
Next
MsgBox(0, "time", TimerDiff($init))



Func _FileListToArrayEx($sPath, $sFilter = '*.*', $iFlag = 0, $sExclude = '', $iRecurse = False)
    If Not FileExists($sPath) Then Return SetError(1, 1, '')
    If $sFilter = -1 Or $sFilter = Default Then $sFilter = '*.*'
    If $iFlag = -1 Or $iFlag = Default Then $iFlag = 0
    If $sExclude = -1 Or $sExclude = Default Then $sExclude = ''
    Local $aBadChar[6] = ['\', '/', ':', '>', '<', '|']
    $sFilter = StringRegExpReplace($sFilter, '\s*;\s*', ';')
    If StringRight($sPath, 1) <> '\' Then $sPath &= '\'
    For $iCC = 0 To 5
        If StringInStr($sFilter, $aBadChar[$iCC]) Or _
            StringInStr($sExclude, $aBadChar[$iCC]) Then Return SetError(2, 2, '')
    Next
    If StringStripWS($sFilter, 8) = '' Then Return SetError(2, 2, '')
    If Not ($iFlag = 0 Or $iFlag = 1 Or $iFlag = 2) Then Return SetError(3, 3, '')
    Local $oFSO = ObjCreate("Scripting.FileSystemObject"), $sTFolder
    $sTFolder = $oFSO.GetSpecialFolder(2)
    Local $hOutFile = @TempDir & $oFSO.GetTempName
    If Not StringInStr($sFilter, ';') Then $sFilter &= ';'
    Local $aSplit = StringSplit(StringStripWS($sFilter, 8), ';'), $sRead, $sHoldSplit
    For $iCC = 1 To $aSplit[0]
        If StringStripWS($aSplit[$iCC],8) = '' Then ContinueLoop
        If StringLeft($aSplit[$iCC], 1) = '.' And _
            UBound(StringSplit($aSplit[$iCC], '.')) - 2 = 1 Then $aSplit[$iCC] = '*' & $aSplit[$iCC]
        $sHoldSplit &= '"' & $sPath & $aSplit[$iCC] & '" '
    Next
    $sHoldSplit = StringTrimRight($sHoldSplit, 1)
    If $iRecurse Then
        RunWait(@Comspec & ' /c dir /b /s /a ' & $sHoldSplit & ' > "' & $hOutFile & '"', '', @SW_HIDE)
    Else
        RunWait(@ComSpec & ' /c dir /b /a ' & $sHoldSplit & ' /o-e /od > "' & $hOutFile & '"', '', @SW_HIDE)
    EndIf
    $sRead &= FileRead($hOutFile)
    If Not FileExists($hOutFile) Then Return SetError(4, 4, '')
    FileDelete($hOutFile)
    If StringStripWS($sRead, 8) = '' Then SetError(4, 4, '')
    Local $aFSplit = StringSplit(StringTrimRight(StringStripCR($sRead), 1), @LF)
    Local $sHold
    For $iCC = 1 To $aFSplit[0]
        If $sExclude And StringLeft($aFSplit[$iCC], _
            StringLen(StringReplace($sExclude, '*', ''))) = StringReplace($sExclude, '*', '') Then ContinueLoop
        Switch $iFlag
            Case 0
                If StringRegExp($aFSplit[$iCC], '\w:\\') = 0 Then
                    $sHold &= $sPath & $aFSplit[$iCC] & Chr(1)
                Else
                    $sHold &= $aFSplit[$iCC] & Chr(1)
                EndIf
            Case 1
                If StringInStr(FileGetAttrib($sPath & '\' & $aFSplit[$iCC]), 'd') = 0 And _
                    StringInStr(FileGetAttrib($aFSplit[$iCC]), 'd') = 0 Then
                    If StringRegExp($aFSplit[$iCC], '\w:\\') = 0 Then
                        $sHold &= $sPath & $aFSplit[$iCC] & Chr(1)
                    Else
                        $sHold &= $aFSplit[$iCC] & Chr(1)
                    EndIf
                EndIf
            Case 2
                If StringInStr(FileGetAttrib($sPath & '\' & $aFSplit[$iCC]), 'd') Or _
                    StringInStr(FileGetAttrib($aFSplit[$iCC]), 'd') Then
                    If StringRegExp($aFSplit[$iCC], '\w:\\') = 0 Then
                        $sHold &= $sPath & $aFSplit[$iCC] & Chr(1)
                    Else
                        $sHold &= $aFSplit[$iCC] & Chr(1)
                    EndIf
                EndIf
        EndSwitch
    Next
    If StringTrimRight($sHold, 1) Then Return StringSplit(StringTrimRight($sHold, 1), Chr(1))
    Return SetError(4, 4, '')
EndFunc;==> _FileListToArrayEx
Edited by Alienware
Link to comment
Share on other sites

16863 files. Heh! :) It errors around the 150th file I believe, I can get an exact number if you need it. In these 16863 files, I've used 5.68GB's.

You could use this:

#include <File.au3>
$Directory = @DesktopDir&"\Test\"
For $i=1 to 1000
_FileCreate("testfile"&$i&".txt")
Next

I'll check this code out, and see if produces the same error.

Just tried it, and it went through 1000 files, and never failed. Hmm.

Edited by Alienware
Link to comment
Share on other sites

  • 2 weeks later...

JPam,

This function just gets better and better. I really love the ability of using a file for a key. Many thanks for this wonderful contribution!

PS

Using this on Vista. Tried compress and encrypt on plain text files. Works like a charm. I did notice in your comments about not using a pre-compressed file like a .JPG or .ZIP. Was curious about that but no big deal. It works perfectly for what I need it for.

Link to comment
Share on other sites

I was thinking about adding an option or function for allowing the dll to find a suitable keyfile for you

like a windows system file with the same or larger lenght then the source file that has to be encrypted.

only on large files you get a keyseqence in the encryption.

it's because , when you specify a string or keyfile in your script , the keyfile can be easy retrieved !

i can let the dll store the path+filename of the keyfile in the encrypted file,

so it's alot harder to retrieve the used keyfile.

what do you guys want something like that in the crypt.dll ?

:P

Edited by jpam
Link to comment
Share on other sites

  • 2 months later...
  • 2 months later...

Hi,

I'm trying to change the script so that I can use a key in the script instead of using a textfile with the key in it.

I have changed the code

From: $key = SetKey(@ScriptDir &"\key.txt") ; Load keyfile

To: $key = SetKey("key")

But the script either crashes or the decrypted file is the same size as the original but the contents has a few lines from the original text file and then

filles wth spaces:

It appears to encounter a problem when it tries to decrypt the encryped file.

I have checked the Crypt.au3 file file and a String should work ok for SetKey($C_Key) but it's not.

; Syntax $Key = SetKey("my password")

; Key can be string or a path + filename)

; Password string or file can be any lenght , even greater then file thats need to be encrypted

; Return value = String or Memory Pointer

Can anyone offers some advice/clues as to why the function is not dencrypting properly?

Wayne

Link to comment
Share on other sites

I see no problems overhere

I'm trying to change the script so that I can use a key in the script instead of using a textfile with the key in it.

I have changed the code

The dll does not read a key in a textfile, but it use the textfile as binary bytes to encrypt/decrypt the source file.

You can even use a mp3 file to encrypt/decrypt.

This is a proper way to use it;

#include "Crypt.au3"

; Compress and Encrypt file
$key = SetKey("key") 
$pMem = ReadFileFast(@ScriptDir&"\readme.txt")

$compress = Compress($pMem) 
Crypt($compress, $key)

WriteFileFast(@ScriptDir&"\readme.txt", $compress)

; Decrypt and Decompress file
$pMem = ReadFileFast(@ScriptDir&"\readme.txt") 

Crypt($pMem, $key)                      
$DeCompress = Decompress($pMem)  

WriteFileFast(@ScriptDir&"\readme.txt", $DeCompress)
DelKey($key)

Exit
Link to comment
Share on other sites

Thanks for your reply, but I'm still a little confused about how I can use a simple password using the code.

Something like this would be useful:

$key = SetKey("387896") or

$key = SetKey("MyClearTextPassword")

My problem is when I use a String as the key as in the examples above.

When I use a filename + path it works ok.

Can you provide an example using a String as the key?

Thanks

Wacy1

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...