diff options
author | Aleksey Veresov <aleksey@veresov.pro> | 2020-10-17 18:24:54 +0300 |
---|---|---|
committer | Aleksey Veresov <aleksey@veresov.pro> | 2020-10-17 18:24:54 +0300 |
commit | 370a55aa3b2480f87a90a83d7b8127f9159af750 (patch) | |
tree | 9bbb89f1bf9b361b3c1217a89ea2f3676fb6578d | |
parent | e89a8b301a0aa57b537ca65fa6019f4d1fa69806 (diff) | |
download | cryptrobber-370a55aa3b2480f87a90a83d7b8127f9159af750.tar cryptrobber-370a55aa3b2480f87a90a83d7b8127f9159af750.tar.xz cryptrobber-370a55aa3b2480f87a90a83d7b8127f9159af750.zip |
Framework completed. =)
-rw-r--r-- | cipher.sts | 8 | ||||
-rw-r--r-- | main.sts | 17 |
2 files changed, 13 insertions, 12 deletions
@@ -3,8 +3,10 @@ defword cipher 2 get as cipher.password 1 get as cipher.len 0 get as cipher.pos - cipher.pos @ cipher.password + @ cipher.byte @ xor cipher.byte ! - cipher.pos @ 1 + cipher.pos ! - cipher.pos @ cipher.len = if 0 cipher.pos ! fi + cipher.pos @ word_size mul cipher.password + @ + cipher.byte @ xor + cipher.byte ! + cipher.pos @ 0 = if cipher.len cipher.pos ! fi + cipher.pos @ 1 - cipher.pos ! drop drop drop exit @@ -5,34 +5,33 @@ set_entry ; read file into stack 0 do sys_read 0 = until swap 1 + - od as length + od drop as length local ciphertext ; -= MAIN LOOP BEGIN =- ; ; place password ontop of stack - 33 32 31 local password + 31 32 33 local password 3 as passlen ; decipher text (length is the same as for ciphertext) - 0 0 do dup length = until - 2 print_stack newline sys_write + passlen 1 - length do 1 - as pos local cipos - pos ciphertext + @ + pos word_size mul ciphertext + @ password passlen cipos cipher swap pos - 1 + od drop drop + dup 0 = untilod drop drop local plaintext ; todo: check deciphering attempt, exit if Ok ; -= MAIN LOOP END =- ; ; output text (todo: and language) - 0 do dup length = until - dup plaintext + @ sys_write - 1 + od + length do 1 - + dup word_size mul plaintext + @ sys_write + dup 0 = untilod sys_exit module ia32/elf/end.sts |