Jump to content

Blowfish File Encryption


Recommended Posts

  • Moderators

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

check out my file encryption udf, its in my signature

My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.
Link to comment
Share on other sites

check out my file encryption udf, its in my signature

Your EncryptOr is a very nice job. What type of encryption does the encrypt.com?

I think it would a great tool if you add some license free strong algorithm like, perhaps blowfish.

Link to comment
Share on other sites

it uses IDEA encryption, did u see my udf below encrypt0r(uses the same encryption but you can implement in your own program

Edited by RazerM
My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.
Link to comment
Share on other sites

it uses IDEA encryption, did u see my udf below encrypt0r(uses the same encryption but you can implement in your own program

Yes, I tested it.

What makes bcrypt interesting is that it is license free and the inclusion of file compression and secure deletion.

IDEA - according Wikipedia:

The cipher is patented in a number of countries but is freely available for non-commercial use.

Link to comment
Share on other sites

i am not selling my program so it isn't commercial use

My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.
Link to comment
Share on other sites

i am not selling my program so it isn't commercial use

What I meant is that if I create an executable using this algorithm, and this is used in any commercial environment, end user has to be warned that he needs to acquire the corresponding license. So I prefer to start with license free software like blowfish and zlib.

[edit]

I tested the encryption of a 34.5 Mb access.mdb database w/default parameters on a P4 @2.4MHz

Encryption took roughly 5 secs. ending in a 9.6 Mb encrypted file.

De-encryption to original file took roughly 2 secs.

(Comparison: I compressed the original file w/Winzip9 w/default settings: 4 secs. - 9.7 Mb

decompression: 3 sec.)

[/edit]

Edited by archai2
Link to comment
Share on other sites

Finally got this working in precarious condition.

As said in my first post I can't figure out the correct usage of STDIN/STDOUT

; TODO: (Pre-alpha working condition)

; Correct usage of STDIN/STDOUT/STDERR

; Add usage of -o command switch

; - Great for loading encrypted files to a variable without writing to disk (i.e. bank/credit card info)

... but this can only be done 'with a little help of my friends...' :)

-- You can find the script on my first post. --

Edited by archai2
Link to comment
Share on other sites

Nope, I'm sorry. Just wasted to much time on this :)

But now it just occured to me that I think I have read that stdin and stdout is detached by @comspec or somthing like that.

So, if you realy want this I think you have to consult Mx63.dll, and posts by nfwu on the topic.

Link to comment
Share on other sites

Returns whatever it gets from STDOUT.

If any error, returns "" and sets @error.

Func _BcryptToStdout($sFileList, $sPassPhrase, $iCompress = 0, $iOverwrite = 3)
    If Not FileExists(@ScriptDir & "\bcrypt.exe") Or Not FileExists(@ScriptDir & "\zlib.dll") Then 
        SetError(1)
        Return ""
    ElseIf StringLen($sPassPhrase) < 8 Or StringLen($sPassPhrase) > 56 Then Return (-2)
        SetError(2)
        Return ""
    EndIf
    Local $sParams = ""
    If $iCompress <> 0 Then $sParams &= " -c"
    If IsNumber($iOverwrite) And $iOverwrite <> 3 Then $sParams &= " -s" & $iOverwrite
    Local $sCMD = @ComSpec & " /C " & '"' & @ScriptDir & "\bcrypt.exe" & '"' & $sParams & ' ' & $sFileList & ''
    Local $hPID = Run($sCMD, @ScriptDir, @SW_HIDE, 1 + 2 + 4)
    StdinWrite($hPID, $sPassPhrase & @CRLF & $sPassPhrase & @CRLF)
    Local $m_data = ""
    while @error = 0
        $m_data = $m_data & StdoutRead($hPID, -1)
    wend
    Return $m_data
EndFunc  ;==>_Bcrypt

#)

Link to comment
Share on other sites

Returns whatever it gets from STDOUT.

If any error, returns "" and sets @error.

Local $hPID = Run($sCMD, @ScriptDir, @SW_HIDE, 1 + 2 + 4)
    StdinWrite($hPID, $sPassPhrase & @CRLF & $sPassPhrase & @CRLF)
    Local $m_data = ""
    while @error = 0
        $m_data = $m_data & StdoutRead($hPID, -1)
    wend
    Return $m_data

#)

Problem is there is nothing to be read on StdoutRead. I think bcrypt is "by design" not script friendly.

If it was this should work

bcrypt Test.txt < passphrase.txt

Where passphrase.txt is a two line file with the password in it.

Link to comment
Share on other sites

Thank you @all of you who tried this out.

@nfwu Thank you for pointing me the solution to get the stream out. With your indications I rewrote the script.

Please note there is a limitation in size when streaming output.

-- Updated script for download in my first post --

Link to comment
Share on other sites

Now I just have to figure out why it did not work with my setup :) I fear the night will be to short :mellow:

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...