From a5ada20d77f6fcf7bf54e49402e55d3b1c56df5e Mon Sep 17 00:00:00 2001 From: Aleksey Veresov Date: Fri, 16 Oct 2020 22:38:45 +0300 Subject: Meh. --- cipher.sts | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) (limited to 'cipher.sts') diff --git a/cipher.sts b/cipher.sts index 72d941e..d351397 100644 --- a/cipher.sts +++ b/cipher.sts @@ -1,18 +1,10 @@ -; cipher is password string (pointer to start and length) and position in it - -defword ciphernew - 0 -exit - -defword mod - swap / drop -exit - -defword cipher ; ... passwd plen ppos key - 3 get 2 get + @ xor ; key = key ^ passwd[ppos] - over 1 + 3 get mod 2 set ; ppos = (ppos + 1) % plen -exit - -defword cipherdel +defword cipher + 3 ref as byte + 2 get as password + 1 get as plen + 0 get as pos + pos @ password + @ byte @ xor byte ! + pos @ 1 + pos ! + pos @ plen = if 0 pos ! fi drop drop drop exit -- cgit v1.2.3