AutoHotkey Community

It is currently May 26th, 2012, 10:10 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 14 posts ] 
Author Message
PostPosted: October 13th, 2008, 8:10 pm 
Offline

Joined: April 4th, 2008, 8:15 pm
Posts: 538
Location: Canada
Image

Only tested on XP for now.

>>>> The EXE <<<<

Quote:
Encrypt/Decrypt
Code:
Encode(Text, Key)
 {
  cKey := Key                                 ;Create copy of "Key"
  if % StrLen(Key) < StrLen(Text)             ;Need "Key" length to be same as or bigger than "Text"
   Loop
    {
     cKey .= Key                              ;Key * 2
     if % StrLen(cKey) >= StrLen(Text)
      break
    }
 
  Loop % StrLen(Text)
   {
    StringMid, t_%A_Index%, Text, %A_Index%, 1         ;Get ASCII value of Text, and ASCII value of Key
    StringMid, k_%A_Index%, cKey, %A_Index%, 1         ;then begin to add the values individially ex//
    cText.= Chr(Asc(k_%A_Index%) + Asc(t_%A_Index%))   ;Key = ab, Text = cd. Get ASCII value of a, then
   }                                                   ;add it to ASCII value of c, get ASCII value of
  return cText                                         ;b and add to ASCII value of d
 }

Decode(Text, Key)
 {
  cKey := Key
  if % StrLen(Key) < StrLen(Text)
   Loop
    {
     cKey .= Key
     if % StrLen(cKey) >= StrLen(Text)
      break
    }
 
  Loop % StrLen(Text)
   {
    StringMid, t_%A_Index%, Text, %A_Index%, 1
    StringMid, k_%A_Index%, cKey, %A_Index%, 1
    cText.= Chr(Asc(t_%A_Index%) - Asc(k_%A_Index%))
   }
  return cText
 }

Crypt V1
Code:
#SingleInstance Force
#NoTrayIcon
SetBatchLines -1

Gui Add, Text, x45 cFF0066, Created by Abhishek Regmi
Gui Add, Edit, x6 y24 w236 h220 vText
Gui Add, Button, y225 x260, Encode
Gui Add, Button, y225 x315, Decode
Gui Add, Text, x250 y25,
(
This program's encryption
is very basic, and it can
only encode a message once
key length dosen't matter
too much either.

Key:
)

Gui Add, Edit, x250 y125 h80 w120 vKey
Gui Show, ,Encode v1.0
return

ButtonEncode:
Gui Submit, NoHide
Text := Encode(Text,Key)
GuiControl, , Text, %Text%
return

ButtonDecode:
Gui Submit, NoHide
Text := Decode(Text,Key)
GuiControl, , Text, %Text%
return

GuiClose:
ExitApp

Decode(Text, Key)
 {
  cKey := Key
  if % StrLen(Key) < StrLen(Text)
   Loop
    {
     cKey .= Key
     if % StrLen(cKey) >= StrLen(Text)
      break
    }
 
  Loop % StrLen(Text)
   {
    StringMid, t_%A_Index%, Text, %A_Index%, 1
    StringMid, k_%A_Index%, cKey, %A_Index%, 1
    cText.= Chr(Asc(t_%A_Index%) - Asc(k_%A_Index%))
   }
  return cText
 }

Encode(Text, Key)
 {
  cKey := Key
  if % StrLen(Key) < StrLen(Text)
   Loop
    {
     cKey .= Key
     if % StrLen(cKey) >= StrLen(Text)
      break
    }
 
  Loop % StrLen(Text)
   {
    StringMid, t_%A_Index%, Text, %A_Index%, 1
    StringMid, k_%A_Index%, cKey, %A_Index%, 1
    cText.= Chr(Asc(k_%A_Index%) + Asc(t_%A_Index%))
   }
  return cText
 }


Installer
Code:
#NoTrayIcon
SetBatchLines -1
Gui -Caption
Gui Color, 0x80B2D3
Gui Add, Edit, r10 ReadOnly,
(
SYMCRYPT v. 1.2
------------------------------
v 1.2
 Encrypt .txt files
  - Drag-n-Drop to the EXE or
  - Right click the .txt file and choose Encrypt.
  - Computer Specific Key
  - Set default key

About Simcrypt
-----------------
Simcrypt is a simple encryption program.

Currently Simcrypt can only encrypt simple text files.

This program should not be used for any serious
purposes, the encryption level is very weak and
errors may occur.

Any feedback or questions can be sent to
  abhishek.regmi@gmail.com

Use at your own risk.
)
Gui Font, s15
Gui Add, Button, w100 x30 y150,Install
Gui Add, Button, w100 x145 y150, Exit
Gui Show, w280 h200
return

ButtonInstall:
IfExist %A_ProgramFiles%\Simpcrypt\
 FileRemoveDir, %A_ProgramFiles%\Simpcrypt\, 1
FileCreateDir %A_ProgramFiles%\Simpcrypt\
FileInstall Encrypt.v_1.2.exe, %A_ProgramFiles%\Simpcrypt\Encrypt.v_1.2.exe
FileInstall Decrypt.v_1.2.exe, %A_ProgramFiles%\Simpcrypt\Decrypt.v_1.2.exe
FileInstall Options.exe, %A_ProgramFiles%\Simpcrypt\Options.exe
FileInstall Uninstall.exe, %A_ProgramFiles%\Simpcrypt\Uninstall.exe
FileInstall Cryptv1.0.exe, %A_ProgramFiles%\Simpcrypt\Cryptv1.0.exe
FileCreateDir %A_StartMenuCommon%\Simpcrypt\
FileCreateShortcut %A_ProgramFiles%\Simpcrypt\Cryptv1.0.exe, %A_StartMenuCommon%\Simpcrypt\Cryptv1.0.lnk
FileCreateShortcut %A_ProgramFiles%\Simpcrypt\Options.exe, %A_StartMenuCommon%\Simpcrypt\Options.lnk
FileCreateShortcut %A_ProgramFiles%\Simpcrypt\Uninstall.exe, %A_StartMenuCommon%\Simpcrypt\Uninstall.lnk
RegWrite REG_SZ, HKEY_CLASSES_ROOT, txtfile\shell\Encrypt\Command, , "%A_ProgramFiles%\Simpcrypt\Encrypt.v_1.2.exe" "`%0"
RegWrite REG_SZ, HKEY_CLASSES_ROOT, txtfile\shell\Decrypt\Command, , "%A_ProgramFiles%\Simpcrypt\Decrypt.v_1.2.exe" "`%0"
Msgbox Symcrypt has successfully been installed!
ButtonExit:
GuiClose:
ExitApp


Options
Code:
#SingleInstance Force
SetBatchLines -1
RegRead Setting, HKEY_CURRENT_USER, Software\Simcrypt
Gui Color, 0x80B2D3
Gui Add, Text, , OPTIONS
Gui Add, CheckBox, x15 y30 vUnique, Auto-Gen Key
Gui Add, CheckBox, x15 y50 vDefault, User Defined Key
Gui Add, Edit, x25 y72 vUserKey, Pur|_01n3d
Gui Add, CheckBox, x15 y95 vSelect, Manual Key
Gui Add, Button, default, Submit

if (Setting = Unique)
 GuiControl, , Unique, 1
else if (Setting = User)
 {
  RegRead UserKey, HKEY_CURRENT_USER, Software\Simcrypt, User
  GuiControl, , Default, 1
  GuiControl, , UserKey, %UserKey%
 }
else
 GuiControl, , Select, 1
Gui Show, w250 h200, Encrypt Options
return



ButtonSubmit:
Gui Submit
if (Unique = 1)
 RegWrite REG_SZ, HKEY_CURRENT_USER, Software\Simcrypt, , Unique
else if (Default = 1)
 {
  RegWrite REG_SZ, HKEY_CURRENT_USER, Software\Simcrypt, , User
  RegWrite REG_SZ, HKEY_CURRENT_USER, Software\Simcrypt, User, %UserKey%
 }
else if (Select = 1)
 RegWrite REG_SZ, HKEY_CURRENT_USER, Software\Simcrypt, , Manual
Msgbox Changes have been made!
GuiClose:
ExitApp


Uninstaller
Code:
FileRemoveDir %A_ProgramFiles%\Simpcrypt\, 1
FileRemoveDir %A_StartMenuCommon%\Simpcrypt, 1
RegDelete HKEY_CLASSES_ROOT, txtfile\shell\Encrypt\
RegDelete HKEY_CLASSES_ROOT, txtfile\shell\Decrypt\
RegDelete HKEY_CURRENT_USER, Software\Simcrypt
Msgbox Symcrypt has successfully been uninstalled!



Last edited by purloinedheart on October 16th, 2008, 2:16 am, edited 3 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 13th, 2008, 10:47 pm 
Offline

Joined: April 4th, 2008, 8:15 pm
Posts: 538
Location: Canada
Current Standing:
None

New features:
- Use windows registry key as a key (Auto Encription / Decription, can only be decripted with your windows key)
- Save key to memory (Don't have to enter key every time)


Last edited by purloinedheart on October 16th, 2008, 2:10 am, edited 2 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 13th, 2008, 11:04 pm 
Offline

Joined: November 1st, 2007, 10:03 pm
Posts: 885
Very cool, however though how strong is the encryption?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 14th, 2008, 1:20 am 
Offline

Joined: April 4th, 2008, 8:15 pm
Posts: 538
Location: Canada
I'm not exactly sure :lol:
I've just started reading up on encryption, and I just know that it's Symmetric Encryption.

In V 1.3 or V 1.4 there will be a stronger encryption, or a choice between different ones.

Oh --
If anyone's using Windows Vista and runs across some trouble please tell me, I've only tested this in XP for now


Report this post
Top
 Profile  
Reply with quote  
 Post subject: ssick
PostPosted: October 14th, 2008, 1:48 am 
dude purloined, like z0mg that shit's sick!! I'm gonna send coded messages all the time noww hehehe xD

GOOD JOB!


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 14th, 2008, 1:57 am 
Offline

Joined: April 4th, 2008, 8:15 pm
Posts: 538
Location: Canada
lol ty Bassem


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 16th, 2008, 2:19 am 
Offline

Joined: April 4th, 2008, 8:15 pm
Posts: 538
Location: Canada
I need a little help - Could anyone using Vista tell me which parts of the code are not working? Thanks


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 16th, 2008, 10:11 am 
Offline
User avatar

Joined: May 10th, 2007, 10:54 am
Posts: 649
Location: .switzerland
hi guys,

There are some minor problems withhin this tool:

1. Bugs:
- what happens if data contains binary zeros?
- what happens if asc(keychar)+asc(textchar) > 255 ?

data will be lost...

2. bad encryption strenght
what you do is like xor ->

key xor text = crypt
key xor crypt = text

but the following ist also fact:

text xor crypt = key

Your encrypten is only secure, when the key has the same lenght as the text and is fully random generated.

Otherwise (like in this case) cryptoanalysis is realy easy done. For example with cumulative analysis, it's easy to break messages.


maby you should use secure encryption algorythms, like AES or blowfish...

_________________
http://securityvision.ch
AHK 2D GAME ENGINE


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Re: ssick
PostPosted: October 21st, 2008, 1:46 pm 
BaN.Kai. wrote:
dude purloined, like z0mg that shit's sick!! I'm gonna send coded messages all the time noww hehehe xD

GOOD JOB!


you can't send messages because your friend won't be able to decrypt them.......I think.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 21st, 2008, 10:23 pm 
Offline

Joined: April 4th, 2008, 8:15 pm
Posts: 538
Location: Canada
It works for all (?) .txt files at the moment, as stated before, it's not a reliable system. I currently do not have time to work on this, but it will eventually be upgraded to a better system.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 24th, 2008, 9:34 am 
Offline

Joined: October 23rd, 2008, 7:00 am
Posts: 26
Lol, mind making a uninstallation script first?
*EDIT: Nevermind. I'm just an idiot..


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 13th, 2010, 6:10 pm 
works vry nice, but it is slow when i try to use it on big img files


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 17th, 2010, 9:42 am 
Offline

Joined: January 2nd, 2010, 6:13 pm
Posts: 105
It's to be noted that if you have plain-text and also the cipher-text, here's how you can discover key: You put the plain-text in the key-field, put the cipher-text in the text-field and press Decode button.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 18th, 2010, 8:29 am 
Offline

Joined: November 12th, 2007, 10:18 am
Posts: 142
Location: South Australia
This is so awesome, Now I can go around and encrypt every single file I have :D Yay!

Also, if you put in a different key to decrypt. It seems to encrypt on top of that and you won't be able to restore your original file.

_________________
Image
Image


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], kenn, xXDarknessXx and 8 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group