This script will perform actual RC4 encryption.
Give it 'pw' and 'data' and 'Gosub Rc4'.
'Result' contains en(de)crypted data.
I optimised it a lot compared to original and now its much faster.
Script
RC4 Encryption
Started by
Rajat
, Aug 10 2004 10:22 AM
33 replies to this topic
#1
-
Posted 10 August 2004 - 10:22 AM
CleanNews.in : Bite sized latest news headlines from India with zero bloat
Hi Rajat,
I haven't fully examined the logic of this but it seems only to work for small amounts of data. The limit varies but is only a few hundred bytes, after which the data remains as cyphertext. Or perhaps are certain characters having unexpected effects?
I haven't fully examined the logic of this but it seems only to work for small amounts of data. The limit varies but is only a few hundred bytes, after which the data remains as cyphertext. Or perhaps are certain characters having unexpected effects?
#2
-
Posted 23 August 2004 - 11:39 AM
i've checked it only for small text snippets. i use it at a couple of places but only for small text portions, for complete files or drives etc. i use specialesed tools.
#3
-
Posted 23 August 2004 - 03:51 PM
CleanNews.in : Bite sized latest news headlines from India with zero bloat
cool script. was wondering if u could help me. I needed a script that would encrypt a password & save it 2 a different file then decrypt it when i ran commands that used the password. :roll:
Example of command:
Example of command:
$Numpad1:: Send,\ Sleep, 100 Send, rcon password sv_players return
#4
-
Posted 09 June 2005 - 08:11 PM
Well this is what I have done so far:
How do i make it so that when i click the "CheckBox" it will toggle show/hide password? while im in the gui :?:
Now I need 2 edit it so it encrypts pass b4 saving & decrypts it when i use RCON command.
NoPassFound = RCON EnterPass = Please enter Password. iniread, RemRCONPass, RCONPASS.INI,Remember,RCONPass,0 iniread, RCONPass, RCONPASS.INI, DATA, RCONPass, 00 iniread, RemPassState, RCONPASS.INI, Remember, PassState, 1 iniread, PassState, RCONPASS.INI, DATA, PassState, 1 ifnotexist RCONPASS.INI ifequal, RCONPass, 00 RCONPass = start: Gui, Add, Checkbox, x185 y82 w20 h20 vPassState Checked%PassState% Gui, Add, Text, x45 y10 w145 h20, %EnterPass% ifequal, PassState, 1 Gui, Add, Edit, x20 y35 w160 h20 vRCONPass Password, %RCONPass% ifequal, PassState, 0 Gui, Add, Edit, x20 y40 w160 h20 vRCONPass, %RCONPass% Gui, Add, Button, x35 y70 w50 h20, OK Gui, Add, Button, x120 y70 w50 h20, Cancel ifequal, DialogCaption, 0 gui, -caption Gui, Show, h100 w200, %NoPassFound% Return GuiClose: ButtonCancel: gui, submit gui, destroy ButtonOK: Gui, submit gui, destroy ifequal, RemRCONPass, 0 iniwrite, %RCONPass%, RCONPASS.INI, DATA, RCONPass ifequal, RemPassState, 1 iniwrite, %PassState%, RCONPASS.INI, DATA, PassState return
How do i make it so that when i click the "CheckBox" it will toggle show/hide password? while im in the gui :?:
Now I need 2 edit it so it encrypts pass b4 saving & decrypts it when i use RCON command.
#5
-
Posted 09 June 2005 - 11:53 PM
the idea is to fill the vars 'text' & 'pw' and do 'gosub crypt'. text will contain encrypted text. to crypt pwd u'll have to put that into the 'text' var.
#6
-
Posted 10 June 2005 - 05:12 AM
CleanNews.in : Bite sized latest news headlines from India with zero bloat
Something like this :?:
Its not fully functional + its just missing a small portion of the code now I think but was wondering if u could tell me if I was on the right track & what u thought of the code so far.
I used yr Encryption formula, hope u dont mind. Couldn't have done it without yr help or without this great program. :!: Also got bits & pieces of the code from other sources & am sorry if I didn't mention u in this or any other post.
PS: Still can't get the checkbox thing 2 work right.Can't toggle hide/show Password while gui is loaded.U know how 2 fix it :?: :?
NoRCONPassFound = RCON EnterRCONPass = Please enter New Password. iniread, RemRCONPass, SETTINGS.INI,Remember,RCONPass,0 iniread, RCONPass, SETTINGS.INI, DATA, RCONPass, 00 iniread, RemRCONPassState, SETTINGS.INI, Remember, RCONPassState, 1 iniread, RCONPassState, SETTINGS.INI, DATA, RCONPassState, 1 ifexist SETTINGS.INI return ifnotexist SETTINGS.INI ifequal, RCONPass, 00 RCONPass = start: Gui, Add, Checkbox, x185 y82 w20 h20 vRCONPassState Checked%RCONPassState% Gui, Add, Text, x30 y10 w145 h20, %EnterRCONPass% ifequal, RCONPassState, 1 Gui, Add, Edit, x20 y35 w160 h20 vRCONPass Password ifequal, RCONPassState, 0 Gui, Add, Edit, x20 y40 w160 h20 vRCONPass Gui, Add, Button, x35 y70 w50 h20, OK Gui, Add, Button, x120 y70 w50 h20, Cancel ifequal, DialogCaption, 0 gui, -caption Gui, Show, h100 w200, %NoRCONPassFound% Return GuiClose: ButtonCancel: gui, submit gui, destroy return ButtonOK: Gui, submit gui, destroy Text = %RCONPass% msgbox, %text% pw = psw Gosub, Crypt msgbox, %Cipher% Text = %Cipher% pw = psw ;Gosub, Crypt ;msgbox, %Cipher% ifequal, RemRCONPass, 0 iniwrite, %Cipher%, SETTINGS.INI, DATA, RCONPass ifequal, RemRCONPassState, 1 iniwrite, %RCONPassState%, SETTINGS.INI, DATA, RCONPassState Crypt: BLines = %A_BatchLines% SetBatchLines, -1 AutoTrim, Off StringLen, PWLen, PW Cipher = Loop, 256 { A = %A_Index% A -= 1 Transform, Mod, Mod, %A%, %PWLen% Mod += 1 StringMid, Chr, PW, %MOD%, 1 Transform, ASC, asc, %Chr% Key%A% = %ASC% sbox%A% = %A% } B = 0 Loop, 256 { A = %A_Index% A -= 1 StringTrimRight, tempsa, sbox%A%, 0 StringTrimRight, tempka, Key%A%, 0 tempB = %B% tempB += %tempsa% tempB += %tempka% Transform, B, Mod, %tempB%, 256 StringTrimRight, tempsb, sbox%B%, 0 sbox%A% = %tempsb% sbox%B% = %tempsa% } tempI = J = StringLen, TLen, Text Loop, %TLen% { A = %A_Index% tempI ++ Transform, I, Mod, %tempI%, 256 StringTrimRight, tempsi, sbox%I%, 0 Divd = %tempsi% Divd += %J% Transform, J, Mod, %Divd%, 256 StringTrimRight, tempsj, sbox%J%, 0 Divd = %tempsi% Divd += %tempsj% Transform, Mod, Mod, %Divd%, 256 StringTrimRight, K, sbox%Mod%, 0 StringMid, Chr, Text, %A%, 1 Transform, ASC, asc, %Chr% Transform, CipherBy, bitxor, %Asc%, %K% Transform, out, chr, %CipherBy% Cipher = %Cipher%%out% } SetBatchLines, %BLines% Return $Numpad1:: Text = %RCONPass% ;msgbox, %text% pw = psw Gosub, Crypt ;msgbox, %Cipher% Text = %Cipher% pw = psw ;Gosub, Crypt ;msgbox, %Cipher% Send,\ Sleep, 100 Send, rcon %Cipher% sv_players return
Its not fully functional + its just missing a small portion of the code now I think but was wondering if u could tell me if I was on the right track & what u thought of the code so far.
I used yr Encryption formula, hope u dont mind. Couldn't have done it without yr help or without this great program. :!: Also got bits & pieces of the code from other sources & am sorry if I didn't mention u in this or any other post.
PS: Still can't get the checkbox thing 2 work right.Can't toggle hide/show Password while gui is loaded.U know how 2 fix it :?: :?
#7
-
Posted 10 June 2005 - 07:19 PM
i'm very bad at understanding other's codes, so here's some simple help:
; Generated using SmartGUI Creator 3.5 Gui, Add, Edit, x6 y17 w130 h20, Gui, Add, Checkbox, x6 y47 w20 h30 g1 vstat, Gui, Show, x158 y110 h85 w144, Generated using SmartGUI Creator 3.5 Return 1: gui, submit, nohide ifequal, stat, 1 guicontrol, +password, edit1 else guicontrol, -password, edit1 return GuiClose: ExitApp
#8
-
Posted 10 June 2005 - 08:16 PM
CleanNews.in : Bite sized latest news headlines from India with zero bloat
Tx :!: This code came in handy & it works.
Although u still have 2 click on the Edit Box after clicking CheckBox 4 it 2 Show/Hide Password it's still better than b4.
Although u still have 2 click on the Edit Box after clicking CheckBox 4 it 2 Show/Hide Password it's still better than b4.
#9
-
Posted 11 June 2005 - 08:08 PM
Hello rajat
your script is exactly what I need, but it only functions on small portions of text or files.
cant you alter it a bit to function on files of the size lets say 1 kbyte? or 700byte?
pleeeeeezzzze
Im too dumb to do it :cry:
ciao
MIchael
your script is exactly what I need, but it only functions on small portions of text or files.
cant you alter it a bit to function on files of the size lets say 1 kbyte? or 700byte?
pleeeeeezzzze
Im too dumb to do it :cry:
ciao
MIchael
#10
-
Posted 14 June 2005 - 12:36 PM
Try the new script
#11
-
Posted 15 June 2005 - 05:53 AM
CleanNews.in : Bite sized latest news headlines from India with zero bloat
Rajat did you update the actual encryption script or one of the reply's?
#12
-
Posted 15 June 2005 - 03:42 PM
"Make it idiot-proof, and someone will make a better idiot."
He updated the encryption script!!!!!!!!!!!
really cool
Thanks a lot!
MIchael
really cool
Thanks a lot!
MIchael
#13
-
Posted 15 June 2005 - 04:23 PM
#14
-
Posted 15 June 2005 - 04:27 PM
I used the last version of the encryption code & added Gui's so I could save it already encrypted in a *.ini file + change the password from time to time.
I made 1 gui to type in & then through that gui encrypt/save the password the 1st time the aplication is run & another gui to decrypt/view/Change password.
My Problem is I mannaged 2 get it working with last version of the code but am having trouble with this version.
Can some1 help me plz?Tx :roll:
I made 1 gui to type in & then through that gui encrypt/save the password the 1st time the aplication is run & another gui to decrypt/view/Change password.
My Problem is I mannaged 2 get it working with last version of the code but am having trouble with this version.
Can some1 help me plz?Tx :roll:
#15
-
Posted 17 June 2005 - 12:36 AM