Admin | Write | GuestBook
[공지] 해당 블로그에 용건이 있으신 분께서는 http://blog.fore.kr/ 의 방명록(Guestbook)으로 부탁드립니다.
오시오키나마이키갸루 암호화 루틴
Category : Programming/Programming Talk | URL : | Written by 포레 ( 2015. 8. 31. 18:16 ) | 신고

 

 

 

"""

 Python 2.7 pseudo-code

 Present by FORE

 http://foreblog.tistory.com/

"""

 

decode_key = []


def create_key_map(adlr):
 if len(decode_key):
  del decode_key[:]
 adlr = adlr&0x7FFFFFFF
 adlr |= (adlr<<0x1F)
 for i in range(0x1F):
  decode_key.append(adlr&0xFF)
  adlr = (adlr>>0x08) | ((adlr&0xFFFFFFFE)<<0x17)

 

def decode(buf,adlr):
 create_key_map(adlr)
 buf = list(struct.unpack('B'*len(buf),buf))
 j = 0
 for i in range(len(buf)):
  buf[i] ^= decode_key[j%0x1F]
  j += 1
 buf = struct.pack('B'*len(buf),*buf)
 return buf

 

 

 

Category
분류 전체보기 (605)
Notice (6)
Programming (79)
DISKER (1)
FSCH (7)
Caption (0)
Rest Time ! (443)
Hobby (64)
Tour (5)
Blind Post (0)
Recent Post
Recent Comment
Link
Calender
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
Total :
Today :
Yesterday :