 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
purloinedheart
Joined: 04 Apr 2008 Posts: 537 Location: Canada
|
Posted: Mon Oct 13, 2008 7:10 pm Post subject: Simple built-in encryptor |
|
|
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 Thu Oct 16, 2008 1:16 am; edited 3 times in total |
|
| Back to top |
|
 |
purloinedheart
Joined: 04 Apr 2008 Posts: 537 Location: Canada
|
Posted: Mon Oct 13, 2008 9:47 pm Post subject: |
|
|
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 Thu Oct 16, 2008 1:10 am; edited 2 times in total |
|
| Back to top |
|
 |
Fry
Joined: 01 Nov 2007 Posts: 885
|
Posted: Mon Oct 13, 2008 10:04 pm Post subject: |
|
|
| Very cool, however though how strong is the encryption? |
|
| Back to top |
|
 |
purloinedheart
Joined: 04 Apr 2008 Posts: 537 Location: Canada
|
Posted: Tue Oct 14, 2008 12:20 am Post subject: |
|
|
I'm not exactly sure
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 |
|
| Back to top |
|
 |
BaN.Kai. Guest
|
Posted: Tue Oct 14, 2008 12:48 am Post subject: ssick |
|
|
dude purloined, like z0mg that shit's sick!! I'm gonna send coded messages all the time noww hehehe xD
GOOD JOB! |
|
| Back to top |
|
 |
purloinedheart
Joined: 04 Apr 2008 Posts: 537 Location: Canada
|
Posted: Tue Oct 14, 2008 12:57 am Post subject: |
|
|
| lol ty Bassem |
|
| Back to top |
|
 |
purloinedheart
Joined: 04 Apr 2008 Posts: 537 Location: Canada
|
Posted: Thu Oct 16, 2008 1:19 am Post subject: |
|
|
| I need a little help - Could anyone using Vista tell me which parts of the code are not working? Thanks |
|
| Back to top |
|
 |
IsNull
Joined: 10 May 2007 Posts: 593 Location: .switzerland
|
Posted: Thu Oct 16, 2008 9:11 am Post subject: |
|
|
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 |
|
| Back to top |
|
 |
Guest2 Guest
|
Posted: Tue Oct 21, 2008 12:46 pm Post subject: Re: ssick |
|
|
| 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. |
|
| Back to top |
|
 |
purloinedheart
Joined: 04 Apr 2008 Posts: 537 Location: Canada
|
Posted: Tue Oct 21, 2008 9:23 pm Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
VIRUX
Joined: 23 Oct 2008 Posts: 26
|
Posted: Fri Oct 24, 2008 8:34 am Post subject: |
|
|
Lol, mind making a uninstallation script first?
*EDIT: Nevermind. I'm just an idiot.. |
|
| Back to top |
|
 |
Guest
|
Posted: Sat Mar 13, 2010 5:10 pm Post subject: |
|
|
| works vry nice, but it is slow when i try to use it on big img files |
|
| Back to top |
|
 |
arsan
Joined: 02 Jan 2010 Posts: 105
|
Posted: Wed Mar 17, 2010 8:42 am Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
happytodd
Joined: 12 Nov 2007 Posts: 142 Location: South Australia
|
Posted: Thu Mar 18, 2010 7:29 am Post subject: |
|
|
This is so awesome, Now I can go around and encrypt every single file I have 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. _________________
 |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|