topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Friday March 29, 2024, 7:50 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Idea: Simple Key Text Encryption Program  (Read 4524 times)

workinprogress

  • Participant
  • Joined in 2009
  • *
  • default avatar
  • Posts: 5
    • View Profile
    • Donate to Member
Idea: Simple Key Text Encryption Program
« on: January 26, 2009, 02:17 AM »
Basically I am looking for a program that you can encrypt and decrypt text on the fly with using a key. I would like to work where you enter a key and a coded or decoded message and it would code or decode it.

workinprogress

  • Participant
  • Joined in 2009
  • *
  • default avatar
  • Posts: 5
    • View Profile
    • Donate to Member
Re: Idea: Simple Key Text Encryption Program
« Reply #1 on: January 26, 2009, 02:22 AM »
Also I was planning to use it when group instant messaging, posting certain things on certain websites, and emailling over unsecured networks.

aCkRiTe

  • Honorary Member
  • Joined in 2007
  • **
  • default avatar
  • Posts: 21
    • View Profile
    • Donate to Member
Re: Idea: Simple Key Text Encryption Program
« Reply #2 on: January 26, 2009, 10:36 AM »
Not exactly sure if this is what you're looking for, but I thought I'd post it. So basically this is an RC4 encryption that I used from http://www.autohotke...ml&highlight=rc4.

How it works:
1. run the script (it can be left running at all times)
2. when you want to encrypt something simply copy the text to the clipboard and then fire the hotkey (ctrl + alt + z)
3. you will be prompted to enter a password which is used for the encryption
4. once you enter a password your text will then be encrypted and then placed back to the clipboard.
5. send your encrypted text to someone that has the same script
6. they place the encrypted text to the clipboard and fire the hotkey (ctrl + alt + z)
7. they have to enter the same password you used to encrypt the text
8. the text will then be decrypted and the original text that you wrote will be placed to the clipboard

AHK
SingleInstance Force
#Persistent
#NoEnv
SetBatchLines, -1

^!x::
Password:
InputBox, PW, Password, Enter a password., , 200, 125
If ErrorLevel <> 0
ExitApp
If PW =
Goto, Password
Data = %Clipboard%
Gosub, RC4
Clipboard = %Result%
Return

RC4:
ATrim = %A_AutoTrim%
AutoTrim, Off
BLines = %A_BatchLines%
SetBatchlines, -1
StringLen, PWLen, PW
IfNotEqual, PW, %OldPW%
{
Loop, 256
{
a := A_Index - 1
Transform, ModVal, Mod, %a%, %PWLen%
ModVal ++
StringMid, C, PW, %ModVal%, 1
Transform, AscVar, Asc, %C%
Key%a% = %AscVar%
sBox%a% = %a%
}
b = 0
Loop, 256
{
a := A_Index - 1
TempVar := b + sBox%a% + Key%a%
Transform, b, Mod, %TempVar%, 256
T := sBox%a%
sBox%a% := sBox%b%
sBox%b% = %T%
}

OldPW = %PW%
}
StringLen, DataLen, Data
Result =
i = 0
j = 0
Loop, %DataLen%
{
TmpVar := i + 1
Transform, i, Mod, %TmpVar%, 256
TmpVar := sBox%i% + j
Transform, j, Mod, %TmpVar%, 256
TmpVar := sBox%i% + sBox%j%
Transform, TmpVar2, Mod, %TmpVar%, 256
k := sBox%TmpVar2%
StringMid, TmpVar, Data, %A_Index%, 1
Transform, AscVar, Asc, %TmpVar%
Transform, C, BitXOR, %AscVar%, %k%
IfEqual, C, 0
C = %k%
Transform, ChrVar, Chr, %C%
Result = %Result%%ChrVar%
}
AutoTrim, %ATrim%
SetBatchlines, %BLines%
Return
GuiClose:
ExitApp


workinprogress

  • Participant
  • Joined in 2009
  • *
  • default avatar
  • Posts: 5
    • View Profile
    • Donate to Member
Re: Idea: Simple Key Text Encryption Program
« Reply #3 on: January 26, 2009, 04:05 PM »
This is exactly what I was looking for! Thank you so much!