module ia32/elf/begin.sts module cipher.sts set_entry ; read file into stack 0 do sys_read 0 = until swap 1 + od drop as length local ciphertext ; -= MAIN LOOP BEGIN =- ; ; place password ontop of stack 31 32 33 local password 3 as passlen ; decipher text (length is the same as for ciphertext) passlen 1 - length do 1 - as pos local cipos pos word_size mul ciphertext + @ password passlen cipos cipher swap pos dup 0 = untilod drop drop local plaintext ; todo: check deciphering attempt, exit if Ok ; -= MAIN LOOP END =- ; ; output text (todo: and language) length do 1 - dup word_size mul plaintext + @ sys_write dup 0 = untilod sys_exit module ia32/elf/end.sts