From 28efe80cca2ae4f30026719e4ad4b49b15862f25 Mon Sep 17 00:00:00 2001 From: Aleksey Veresov Date: Sun, 18 Oct 2020 12:24:39 +0300 Subject: More alphas in text. --- main.sts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'main.sts') diff --git a/main.sts b/main.sts index 69d8d81..ee11303 100644 --- a/main.sts +++ b/main.sts @@ -51,11 +51,12 @@ defword checktext drop drop drop drop drop drop drop drop drop drop drop drop drop 0 exit fi drop dup 0 = untilod drop -; ZERO DIVISION SHALL NOT PASS -checktext.count 0 = if drop - drop drop drop drop drop drop drop drop drop drop drop drop drop - drop drop drop drop drop drop drop drop drop drop drop drop drop -0 exit fi + ; At least half characters in text should be alphabetical: + checktext.count float_iload checktext.length float_iload float_div + 1 float_iload 2 float_iload float_div float_more if drop + drop drop drop drop drop drop drop drop drop drop drop drop drop + drop drop drop drop drop drop drop drop drop drop drop drop drop + 0 exit fi ; normalize: 0 do dup 1a = until dup word_size mul checktext.fr + dup @ float_iload @@ -82,6 +83,7 @@ set_entry float_init ; this is program with floats do ; generate next key to try keygen as keylen local key + '.' sys_write_err ; decipher text (length is the same as for ciphertext) keylen 1 - length do 1 - -- cgit v1.2.3