css securitylab & fop parser
This commit is contained in:
parent
7bbf3a5070
commit
1eadfe70da
5 changed files with 283 additions and 0 deletions
24
onetimepad.rkt
Normal file
24
onetimepad.rkt
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
#lang racket
|
||||
|
||||
(define c1 (list #x32 #x1b #x61 #x49 #x48 #x1c #x03 #x2a #x1e #x06 #x5e #x32 #x28 #x24 #x5c #x24))
|
||||
(define c2 (list #x1a #x12 #x12 #x3c #x48 #x39 #x58 #x01 #x39 #x41 #x50 #x41 #x2a #x18 #x5c #x1c))
|
||||
(define c3 (list #x1c #x1c #x22 #x2d #x47 #x5f #x29 #x29 #x37 #x78 #x02 #x26 #x2b #x3e #x08 #x1e))
|
||||
|
||||
(define known-str (bytes->list #"js61xumi"))
|
||||
(define known-str-len (length known-str))
|
||||
|
||||
(define key-part-1 (map bitwise-xor known-str (take c1 known-str-len)))
|
||||
(define key-part-2 (map bitwise-xor known-str (drop c2 known-str-len)))
|
||||
(define key (append key-part-1 key-part-2))
|
||||
|
||||
(define (decrypt bytes key)
|
||||
(map bitwise-xor bytes key))
|
||||
|
||||
(define m1 (decrypt c1 key))
|
||||
(define m2 (decrypt c2 key))
|
||||
(define m3 (decrypt c3 key))
|
||||
|
||||
(displayln (list->bytes m1))
|
||||
(displayln (list->bytes m2))
|
||||
(displayln (list->bytes m3))
|
||||
(displayln (list->bytes key))
|
||||
Loading…
Add table
Add a link
Reference in a new issue