module ia32/elf/begin.sts module cipher.sts set_entry ; read file into stack 0 do sys_read 0 = until swap 1 + od as length local ciphertext ; -= MAIN LOOP BEGIN =- ; ; place password ontop of stack 33 32 31 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 as pos local cipos pos ciphertext + @ password passlen cipos cipher swap pos 1 + od 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 sys_exit module ia32/elf/end.sts