Encrypt/DecryptCode:
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 V1Code:
#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
}
InstallerCode:
#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
OptionsCode:
#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
UninstallerCode:
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!