Sign in to follow this  
Followers 0
ezzetabi

Command Line Encrypter, Idea

8 posts in this topic

#1 ·  Posted (edited)

As trids command I post a link to the 448 bytes cypher, IDEA:

http://www.cypherspace.org/adam/rsa/idea.html

And also a short example with a code that uses it.

It is intended that you already FILEINSTALL() the program with the name of IDEA.COM

$pass = "what you want";Max 128 chars
$filename = "c:\this is an example\e.txt";The file to encrypt
$mode = "+";or "-" usually + is used for encrypt, - for decrypt but it can be vice versa.
Run(@comspec & " /c echo " & $pass & "|idea.com " & $mode & " " & FileGetShortName($filename),"",@sw_hide)
Edited by ezzetabi

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Since this program crypt the file "on-the-place" it may be also used for secure deletion.

Like this way:

$FILENAME = "C:\this is a\example\do you see.txt"
$TIMES = 100;higher means more secure

;The real program...

;Step 1 - crypt/decrypt the file to prevent readability of the content.
For $C = 1 To $TIMES
   $PASS = Int(Random(5, 101))
  ;The pass can be long 5 - 100 chars

   $PASS = _RandomText($PASS)
  ;and it is a random sequence of maiusc or minusc letters (see the func)

   If Random() < .5 Then
  ;as Random() result Idea may decryp or crypt
      $MODE = "+"
   Else
      $MODE = "-"
   EndIf
   
   Run(@ComSpec & " /c echo " & $PASS & "|idea.com " & $MODE & " " & _
FileGetShortName($FILENAME), "", @SW_HIDE)
  ;(de)cryption it self
Next

;Step 2 dividing filename and path
For $C = StringLen($FILENAME) To 0 Step - 1
   If StringMid($FILENAME, $C, 1) == "\" Then
      $FILE = StringTrimLeft($FILENAME, $C)
      $FOLDER = StringLeft($FILENAME, $C);Now ($folder & $file) is the full path
      ExitLoop
   EndIf
Next

;Step 3 rename the file in order to avoid readability of the name.
For $C = 1 To $TIMES * 2 
   $NEWNAME = _RandomText(Int(Random(10,41)))
   FileMove($FOLDER & $FILE, $FOLDER & $NEWNAME, 0)
   $FILE = $NEWNAME
Next

;Step 4 deletion of the strangely named wastes.
FileDelete($FOLDER & $FILE)


Exit
Func _RandomText($N)
  ;$n is the lenght of string.
   If $N < 1 Then Return -1
   Local $COUNTER, $ALPHA, $RESULT
   
   For $COUNTER = 1 To $N
      If Random() < 0.5 Then
         $ALPHA = Chr(Random(Asc("A"), Asc("Z") + 1))
      Else
         $ALPHA = Chr(Random(Asc("a"), Asc("z") + 1))
      EndIf
      $RESULT = $RESULT & $ALPHA
   Next
   Return $RESULT
EndFunc  ;==>_RandomText
Edited by ezzetabi

Share this post


Link to post
Share on other sites

Crypt and secure deletion are really so unimportant topic that none answers or comment?

Share this post


Link to post
Share on other sites

wow, this is nice! I'm gonna use this sometime soon, so thanks for this post!

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

This is a great Tool !

Edited by Micha1405

Share this post


Link to post
Share on other sites

ezzetabi made a nice find.

In the while no encryption plugin neither dllcall went out :o

Anyone know about a tiny command line tool that make compression too?

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