Messages - aCkRiTe [ switch to compact view ]

Pages: [1] 2 3 4 5next
1
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.autohotkey.com/forum/topic598.html&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


2
Coding Snacks / Re: Create Multiple Empty Numbered Folders
« on: January 10, 2009, 02:23 AM »
Loop, 150
{
StringLen, Length, A_Index
If Length = 1
FileCreateDir, 00%A_Index%
If Length = 2
FileCreateDir, 0%A_Index%
If Length = 3
FileCreateDir, %A_Index%
}
ExitApp

3
Coding Snacks / Re: Create Multiple Empty Numbered Folders
« on: January 09, 2009, 09:29 AM »
Heres a way with AHK. Just run the script from the directory or location you want the folders to be created.

Loop, 150
FileCreateDir, %A_Index%
ExitApp

If you want to use a batch file you can use this. Of course change the path as needed.

for /l %%i in (1,1,150) do mkdir "C:\Test\%%i"

4
Coding Snacks / Re: Sticky Keys Ahk request
« on: December 15, 2008, 11:24 AM »
If you're not getting the pop-up then its not changing the registry value when it loses the StickyKeys. If thats the case then Im not sure how else to tell that you're losing the StickyKeys.  :(

5
Coding Snacks / Re: Automated folder maker
« on: December 15, 2008, 11:16 AM »
Here is an AHK script that should do it for you. This assumes you have 1 directory with many .pdf files in it, it will loop through getting each file name and create a new directory(within the main/root directory) with the current file name then move the file in to the new directory with the matching name.

*I have tested, but you should always have a backup or copy of the directory you're working on before using this script*

#SingleInstance Force
#Persistent
#NoEnv
SetBatchLines -1

FileSelectFolder, Root, , , Select Root Folder
If ErrorLevel = 1
Reload
Loop, %Root%\*.pdf
{
StringTrimRight, Folder, A_LoopFileName, 4
FileCreateDir, %Root%\%Folder%
FileMove, %A_LoopFileFullPath%, %Root%\%Folder%\%A_LoopFileName%
}
ExitApp

Pages: [1] 2 3 4 5next
Go to full version