aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksey Veresov <aleksey@veresov.pro>2020-10-18 18:22:31 +0300
committerAleksey Veresov <aleksey@veresov.pro>2020-10-18 18:22:31 +0300
commitdf0d6a4503a26508553510b4050eaa79f52e4e4e (patch)
tree2517b6070319270a4cb0df9dcf3814b16ecaece9
parent9eadc7bac8863b7fd3a39edc9ba31cf4d3b5ab95 (diff)
downloadcryptrobber-df0d6a4503a26508553510b4050eaa79f52e4e4e.tar
cryptrobber-df0d6a4503a26508553510b4050eaa79f52e4e4e.tar.xz
cryptrobber-df0d6a4503a26508553510b4050eaa79f52e4e4e.zip
Another step to release.
-rw-r--r--Makefile22
-rw-r--r--README17
-rw-r--r--base/smack.c (renamed from enki/smack.c)0
-rw-r--r--base/strans.c (renamed from enki/strans.c)0
-rw-r--r--common/common.sts3
-rw-r--r--cryptrobber.sts (renamed from main.sts)21
-rw-r--r--encrypt.sts6
-rw-r--r--ia32/float/float.sts3
-rw-r--r--ia32/ia32.sts8
-rw-r--r--samples/kernel-options.txt (renamed from kernel-options.txt)0
-rw-r--r--samples/man.txt (renamed from man.txt)0
-rw-r--r--samples/orwell.txt (renamed from orwell.txt)0
-rw-r--r--samples/speculation.txt (renamed from speculation.txt)0
-rw-r--r--samples/spinlocks.txt (renamed from spinlocks.txt)0
-rw-r--r--sts/bifreq.sts (renamed from bifreq.sts)0
-rw-r--r--sts/cipher.sts (renamed from cipher.sts)0
-rw-r--r--sts/common/.print.sts.swpbin0 -> 12288 bytes
-rw-r--r--sts/common/common.sts3
-rw-r--r--sts/common/const.sts (renamed from common/const.sts)0
-rw-r--r--sts/common/macro.sts (renamed from common/macro.sts)0
-rw-r--r--sts/common/print.sts (renamed from common/print.sts)0
-rw-r--r--sts/freq.sts (renamed from freq.sts)0
-rw-r--r--sts/ia32/bitwise.sts (renamed from ia32/bitwise.sts)0
-rw-r--r--sts/ia32/branch.sts (renamed from ia32/branch.sts)0
-rw-r--r--sts/ia32/const.sts (renamed from ia32/const.sts)0
-rw-r--r--sts/ia32/core.sts (renamed from ia32/core.sts)0
-rw-r--r--sts/ia32/elf/begin.sts (renamed from ia32/elf/begin.sts)6
-rw-r--r--sts/ia32/elf/end.sts (renamed from ia32/elf/end.sts)0
-rw-r--r--sts/ia32/elf/syscall.sts (renamed from ia32/elf/syscall.sts)0
-rw-r--r--sts/ia32/float/control.sts (renamed from ia32/float/control.sts)0
-rw-r--r--sts/ia32/float/float.sts3
-rw-r--r--sts/ia32/float/math.sts (renamed from ia32/float/math.sts)0
-rw-r--r--sts/ia32/float/stack.sts (renamed from ia32/float/stack.sts)0
-rw-r--r--sts/ia32/ia32.sts8
-rw-r--r--sts/ia32/macro.sts (renamed from ia32/macro.sts)0
-rw-r--r--sts/ia32/math.sts (renamed from ia32/math.sts)0
-rw-r--r--sts/ia32/memory.sts (renamed from ia32/memory.sts)0
-rw-r--r--sts/ia32/stack.sts (renamed from ia32/stack.sts)0
-rw-r--r--sts/keygen.sts (renamed from keygen.sts)0
-rw-r--r--test.sts10
40 files changed, 56 insertions, 54 deletions
diff --git a/Makefile b/Makefile
index 823e0f2..c0230f2 100644
--- a/Makefile
+++ b/Makefile
@@ -1,23 +1,19 @@
-all: cryptrobber encrypt test
-.PHONY: all clean cryptrobber encrypt test
+all: cryptrobber encrypt
+.PHONY: all clean cryptrobber encrypt
-cryptrobber: enki/smack enki/strans
- enki/smack main.sts | enki/strans > $@
+cryptrobber: base/smack base/strans
+ base/smack cryptrobber.sts | base/strans > $@
chmod 0755 $@
-encrypt: enki/smack enki/strans
- enki/smack encrypt.sts | enki/strans > $@
+encrypt: base/smack base/strans
+ base/smack encrypt.sts | base/strans > $@
chmod 0755 $@
-test: enki/smack enki/strans
- enki/smack test.sts | enki/strans > $@
- chmod 0755 $@
-
-enki/smack: enki/smack.c
+base/smack: base/smack.c
gcc $< -o $@
-enki/strans: enki/strans.c
+base/strans: base/strans.c
gcc $< -o $@
clean:
- rm -f enki/smack enki/strans cryptrobber encrypt test
+ rm -f base/smack base/strans cryptrobber encrypt
diff --git a/README b/README
index f8eda72..88213dc 100644
--- a/README
+++ b/README
@@ -1,3 +1,5 @@
+-= Overview
+
This program will work only on Linux.
To build everything run 'make'.
@@ -7,9 +9,20 @@ Simple test can be done with
./encrpyt < README | ./cryptrobber > README.copy
The test should show that original text is written in english
-and that default key is 31 32 33 in hex or 123 as ASCII.
+and that default key is 31 32 in hex. Since the key can be anything
+it is printted in hex, but you can lookup ASCII to find what string it is.
Decrypted README will be in README.copy.
+-= Project Structure
+
+'base' directory contains strans translator and smack macro processor.
+STS files in project root directory are main files of corresponding programs.
+'encrypt' will encrypt its input with hardcoded key. You can use it as:
+
+ ./encrpyt < file_to_your_file > path_to_save_encrypted_data
+'cryptrobber' will try different keys on it input, and if deciphered text
+will met requirements cryptrobber will output predicted language and key.
+So the thing is breaking encrypted files, use it as:
-Following text is added for stability:
+ ./cryptrobber < path_to_encrypted_data > path_to_save_decrypted_data
diff --git a/enki/smack.c b/base/smack.c
index f6f9f30..f6f9f30 100644
--- a/enki/smack.c
+++ b/base/smack.c
diff --git a/enki/strans.c b/base/strans.c
index e3d834d..e3d834d 100644
--- a/enki/strans.c
+++ b/base/strans.c
diff --git a/common/common.sts b/common/common.sts
deleted file mode 100644
index 8a7f835..0000000
--- a/common/common.sts
+++ /dev/null
@@ -1,3 +0,0 @@
-module common/macro.sts
-module common/const.sts
-module common/print.sts
diff --git a/main.sts b/cryptrobber.sts
index f112c30..b8b120d 100644
--- a/main.sts
+++ b/cryptrobber.sts
@@ -1,9 +1,9 @@
-module ia32/elf/begin.sts
-module ia32/float/float.sts
-module cipher.sts
-module keygen.sts
-module freq.sts
-module bifreq.sts
+module sts/ia32/elf/begin.sts
+module sts/ia32/float/float.sts
+module sts/cipher.sts
+module sts/keygen.sts
+module sts/freq.sts
+module sts/bifreq.sts
[ sd 0 swap drop ]
@@ -203,8 +203,11 @@ set_entry float_init ; this is program with floats
; output key
keylen do 1 -
- dup word_size mul key + @ sys_write_err
- dup 0 = untilod drop newline sys_write_err
+ dup word_size mul key + @
+ dup 4 shr get_hex sys_write_err get_hex sys_write_err
+ dup 0 = until
+ space sys_write_err
+ od drop newline sys_write_err
sys_exit
-module ia32/elf/end.sts
+module sts/ia32/elf/end.sts
diff --git a/encrypt.sts b/encrypt.sts
index 2422e66..fa105a8 100644
--- a/encrypt.sts
+++ b/encrypt.sts
@@ -1,5 +1,5 @@
-module ia32/elf/begin.sts
-module cipher.sts
+module sts/ia32/elf/begin.sts
+module sts/cipher.sts
set_entry
31 32 local password
@@ -10,4 +10,4 @@ set_entry
od
sys_exit
-module ia32/elf/end.sts
+module sts/ia32/elf/end.sts
diff --git a/ia32/float/float.sts b/ia32/float/float.sts
deleted file mode 100644
index d6907ca..0000000
--- a/ia32/float/float.sts
+++ /dev/null
@@ -1,3 +0,0 @@
-module ia32/float/control.sts
-module ia32/float/stack.sts
-module ia32/float/math.sts
diff --git a/ia32/ia32.sts b/ia32/ia32.sts
deleted file mode 100644
index 38b5919..0000000
--- a/ia32/ia32.sts
+++ /dev/null
@@ -1,8 +0,0 @@
-module ia32/macro.sts
-module ia32/const.sts
-module ia32/core.sts
-module ia32/stack.sts
-module ia32/branch.sts
-module ia32/memory.sts
-module ia32/math.sts
-module ia32/bitwise.sts
diff --git a/kernel-options.txt b/samples/kernel-options.txt
index eaf32a1..eaf32a1 100644
--- a/kernel-options.txt
+++ b/samples/kernel-options.txt
diff --git a/man.txt b/samples/man.txt
index 919f62c..919f62c 100644
--- a/man.txt
+++ b/samples/man.txt
diff --git a/orwell.txt b/samples/orwell.txt
index da65e79..da65e79 100644
--- a/orwell.txt
+++ b/samples/orwell.txt
diff --git a/speculation.txt b/samples/speculation.txt
index e9e6cba..e9e6cba 100644
--- a/speculation.txt
+++ b/samples/speculation.txt
diff --git a/spinlocks.txt b/samples/spinlocks.txt
index 97eaf57..97eaf57 100644
--- a/spinlocks.txt
+++ b/samples/spinlocks.txt
diff --git a/bifreq.sts b/sts/bifreq.sts
index dcf4858..dcf4858 100644
--- a/bifreq.sts
+++ b/sts/bifreq.sts
diff --git a/cipher.sts b/sts/cipher.sts
index c87b67a..c87b67a 100644
--- a/cipher.sts
+++ b/sts/cipher.sts
diff --git a/sts/common/.print.sts.swp b/sts/common/.print.sts.swp
new file mode 100644
index 0000000..d3a74a8
--- /dev/null
+++ b/sts/common/.print.sts.swp
Binary files differ
diff --git a/sts/common/common.sts b/sts/common/common.sts
new file mode 100644
index 0000000..e0e33cf
--- /dev/null
+++ b/sts/common/common.sts
@@ -0,0 +1,3 @@
+module sts/common/macro.sts
+module sts/common/const.sts
+module sts/common/print.sts
diff --git a/common/const.sts b/sts/common/const.sts
index b1a08b0..b1a08b0 100644
--- a/common/const.sts
+++ b/sts/common/const.sts
diff --git a/common/macro.sts b/sts/common/macro.sts
index 162bf2f..162bf2f 100644
--- a/common/macro.sts
+++ b/sts/common/macro.sts
diff --git a/common/print.sts b/sts/common/print.sts
index a3bea56..a3bea56 100644
--- a/common/print.sts
+++ b/sts/common/print.sts
diff --git a/freq.sts b/sts/freq.sts
index 9935d72..9935d72 100644
--- a/freq.sts
+++ b/sts/freq.sts
diff --git a/ia32/bitwise.sts b/sts/ia32/bitwise.sts
index 205e618..205e618 100644
--- a/ia32/bitwise.sts
+++ b/sts/ia32/bitwise.sts
diff --git a/ia32/branch.sts b/sts/ia32/branch.sts
index 35177f6..35177f6 100644
--- a/ia32/branch.sts
+++ b/sts/ia32/branch.sts
diff --git a/ia32/const.sts b/sts/ia32/const.sts
index 31f8041..31f8041 100644
--- a/ia32/const.sts
+++ b/sts/ia32/const.sts
diff --git a/ia32/core.sts b/sts/ia32/core.sts
index 4a5e692..4a5e692 100644
--- a/ia32/core.sts
+++ b/sts/ia32/core.sts
diff --git a/ia32/elf/begin.sts b/sts/ia32/elf/begin.sts
index 8dab930..16d3355 100644
--- a/ia32/elf/begin.sts
+++ b/sts/ia32/elf/begin.sts
@@ -124,6 +124,6 @@ _return_stack ?.
; jmp dword [eax]
# ff ?' # 20 ?'
-module ia32/ia32.sts
-module ia32/elf/syscall.sts
-module common/common.sts
+module sts/ia32/ia32.sts
+module sts/ia32/elf/syscall.sts
+module sts/common/common.sts
diff --git a/ia32/elf/end.sts b/sts/ia32/elf/end.sts
index 7c80eec..7c80eec 100644
--- a/ia32/elf/end.sts
+++ b/sts/ia32/elf/end.sts
diff --git a/ia32/elf/syscall.sts b/sts/ia32/elf/syscall.sts
index 3acfef2..3acfef2 100644
--- a/ia32/elf/syscall.sts
+++ b/sts/ia32/elf/syscall.sts
diff --git a/ia32/float/control.sts b/sts/ia32/float/control.sts
index 3863f5f..3863f5f 100644
--- a/ia32/float/control.sts
+++ b/sts/ia32/float/control.sts
diff --git a/sts/ia32/float/float.sts b/sts/ia32/float/float.sts
new file mode 100644
index 0000000..acaf3a0
--- /dev/null
+++ b/sts/ia32/float/float.sts
@@ -0,0 +1,3 @@
+module sts/ia32/float/control.sts
+module sts/ia32/float/stack.sts
+module sts/ia32/float/math.sts
diff --git a/ia32/float/math.sts b/sts/ia32/float/math.sts
index d02b491..d02b491 100644
--- a/ia32/float/math.sts
+++ b/sts/ia32/float/math.sts
diff --git a/ia32/float/stack.sts b/sts/ia32/float/stack.sts
index 8c16fef..8c16fef 100644
--- a/ia32/float/stack.sts
+++ b/sts/ia32/float/stack.sts
diff --git a/sts/ia32/ia32.sts b/sts/ia32/ia32.sts
new file mode 100644
index 0000000..dc3d06f
--- /dev/null
+++ b/sts/ia32/ia32.sts
@@ -0,0 +1,8 @@
+module sts/ia32/macro.sts
+module sts/ia32/const.sts
+module sts/ia32/core.sts
+module sts/ia32/stack.sts
+module sts/ia32/branch.sts
+module sts/ia32/memory.sts
+module sts/ia32/math.sts
+module sts/ia32/bitwise.sts
diff --git a/ia32/macro.sts b/sts/ia32/macro.sts
index fa9510b..fa9510b 100644
--- a/ia32/macro.sts
+++ b/sts/ia32/macro.sts
diff --git a/ia32/math.sts b/sts/ia32/math.sts
index 609a21a..609a21a 100644
--- a/ia32/math.sts
+++ b/sts/ia32/math.sts
diff --git a/ia32/memory.sts b/sts/ia32/memory.sts
index 240c598..240c598 100644
--- a/ia32/memory.sts
+++ b/sts/ia32/memory.sts
diff --git a/ia32/stack.sts b/sts/ia32/stack.sts
index e884098..e884098 100644
--- a/ia32/stack.sts
+++ b/sts/ia32/stack.sts
diff --git a/keygen.sts b/sts/keygen.sts
index 6067c0d..6067c0d 100644
--- a/keygen.sts
+++ b/sts/keygen.sts
diff --git a/test.sts b/test.sts
deleted file mode 100644
index 2d234e3..0000000
--- a/test.sts
+++ /dev/null
@@ -1,10 +0,0 @@
-module ia32/elf/begin.sts
-module ia32/float/float.sts
-module bifreq.sts
-
-set_entry
- bifreq_eng
- 300 print_stack
-sys_exit
-
-module ia32/elf/end.sts