AUTOHOTKEY/스크립트
암호 인코드 디코드
님투
2007. 10. 23. 15:43
반응형
passwd = "1334512345" ; 암호
Data = "codedata:http://infoki.net" ; 암호화 코드
Crypt_string := Crypt(Data, passwd)
MsgBox, %Crypt_string% ; 암호화된 문자
Decrypt_string := Decrypt(Data, Crypt_string)
MsgBox, %Decrypt_string% ; 암호 해독된 문자
;------------------------------------------------------------- ; 암호 인코드 디코드 ;------------------------------------------------------------- Crypt(Data,_string) { local f, r f := A_FormatInteger SetFormat Integer, H Loop Parse, _string { r .= Asc(A_LoopField) ^ Asc(SubStr(Data, A_Index, 1)) + 256 } StringReplace r, r, 0x1, , All StringUpper r, r SetFormat Integer, %f% Return r } ; copy clear password, hit Ctrl+Alt+k to get in clipboard the encrypted
; string to paste in the script ; ^!k:: Clipboard := Crypt(Clipboard) Decrypt(Data,_string) { local d, r d := RegExReplace(_string, "..", "0x$0!") StringTrimRight d, d, 1 Loop Parse, d, ! { r .= Chr((A_LoopField + 0) ^ Asc(SubStr(Data, A_Index, 1))) } Return r }
반응형