-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Experimenting with 1-dimensional maps and improved command line inter…
…face
- Loading branch information
Patrick Cieplak
committed
Apr 3, 2016
1 parent
1d372f2
commit 1f04142
Showing
5 changed files
with
55 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,33 @@ | ||
# Yorke | ||
|
||
Yorke is an experimental encryption library and command-line tool. | ||
Yorke is an experimental stream cipher library and command-line tool. | ||
|
||
# Usage | ||
|
||
Encrypt a file using a randomly generated pad. The encrypted cipher text is | ||
sent to STDOUT and the random pad is sent STDERR: | ||
Encrypt a message with a random pad: | ||
|
||
``` | ||
cat plain.txt | yorke random_pad 1> cipher.txt 2> key.txt | ||
cat plain.txt | yorke rp 1> cipher.txt 2> key.txt | ||
``` | ||
|
||
Decrypt a file using a previously generated pad: | ||
|
||
``` | ||
yorke file_xor cipher.txt key.txt > plain.txt | ||
yorke fxor key.txt cipher.txt > plain.txt | ||
```bash | ||
yorke xor <(echo "secret message") <(cat /dev/urandom | tee key.txt) > cipher.txt | ||
yorke xor cipher.txt key.txt | ||
``` | ||
|
||
# Installation | ||
|
||
``` | ||
```bash | ||
git clone https://github.com/ldgr/yorke.git | ||
cd yorke | ||
python setup.py install | ||
``` | ||
|
||
# Testing | ||
|
||
Library: | ||
``` | ||
Run library tests: | ||
```bash | ||
pip install nose | ||
nosetests | ||
``` | ||
|
||
Command: | ||
``` | ||
Run command tests: | ||
```bash | ||
./test.sh | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,13 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
SECRET='More secret than top secret' | ||
|
||
mkdir out || echo "directory ./out exists" | ||
cd out | ||
|
||
printf "$SECRET" | yorke random_pad 1> cipher.txt 2> key.txt | ||
printf "$SECRET" | yorke rp 1> cipher.txt 2> key.txt | ||
|
||
printf "$SECRET" > expected.txt | ||
|
||
yorke file_xor cipher.txt key.txt > plain.txt | ||
diff <(xxd plain.txt) <(xxd expected.txt) | ||
|
||
yorke fxor key.txt cipher.txt > plain.txt | ||
diff <(xxd plain.txt) <(xxd expected.txt) | ||
echo 'More secret than top secret' > plain.txt | ||
|
||
cat key.txt | yorke fxor cipher.txt > plain.txt | ||
diff <(xxd plain.txt) <(xxd expected.txt) | ||
yorke xor plain.txt <(cat /dev/urandom | tee key.txt) > cipher.txt | ||
yorke xor cipher.txt key.txt > plain2.txt | ||
diff <(xxd plain.txt) <(xxd plain2.txt) | ||
|
||
echo "Tests Ran Successfully" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters