mystiko 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3653317c8191c6dffe9aa4679789f55914e508e0
4
- data.tar.gz: 08d04a4d984b8b84c29a5afeff1b94b6be02bf95
3
+ metadata.gz: 5c51d35ea70b716ac0e8919fb8ae9edc5cad499e
4
+ data.tar.gz: 2bffcef13afb643b6fc3de882f6fcaa1387113b0
5
5
  SHA512:
6
- metadata.gz: 7a55ec569cc4f002731391e8d27a6cd03994f7bee926f3415902a07446cd3e67471eabcbfedbaccbd7f8077634e133916b450cd54005a44f60f2876156075dc4
7
- data.tar.gz: b3fd17e8cec9de5c080808356e51d118b4051c33db7472a48924f8b130a1c2fedd64f657b84997e279d0b0986bb53d837f0b0757366e0a8bece5734d6e4c6152
6
+ metadata.gz: 746c0dd4aab8f1b00fefca0e244ebc0a1602d425683a8e33fb6952fe517c3867c949d7b847b09bf5041eb350860b238afe1b8c91a1b0c74b47bdf69984415e7b
7
+ data.tar.gz: 34a1d022bb95bdc0ce0a87cdc5f8a8a39a4c1b6a4800d59abdda7176774faa7a6c57c91dd1e21f0575ee9b44f6d91bd9c79686255fdaab6601a5f334f7289b0c
data/.gitignore CHANGED
@@ -8,3 +8,5 @@
8
8
  /pkg/
9
9
  /spec/reports/
10
10
  /tmp/
11
+ answer.txt
12
+ key.txt
data/README.md CHANGED
@@ -32,6 +32,9 @@ Mystikó is both a ruby gem and a command line utility. In order to work
32
32
  with the encryption engine two things must be done:
33
33
 
34
34
  - An instance must be created. This is easily done with the new method.
35
+
36
+ and then one of the following two options:
37
+
35
38
  - Encryption is done with the encrypt method and appropriate parameters.
36
39
  - Decryption is done with the decrypt method and appropriate parameters.
37
40
 
@@ -72,16 +75,17 @@ arguments or the "--help", "-h", or "-?" options.
72
75
  - If -r is specified, -i is ignored.
73
76
  - String data may be optionally enclosed in " ... "
74
77
 
75
- ## Princples of Operation
78
+ ## Principles of Operation
76
79
 
77
80
  #### The Vernam Cypher
78
81
 
79
- The mystikó gem is a modified Vernam cypher. The classic approach to
80
- this type of cypher is to have a random string of data of the same length as
81
- the plain text data. The two streams of data are combined using the XOR
82
- operation. To recover the original data, the cypher data is again combined with
83
- the random data with the XOR operation. After one use, the random data is
84
- never reused.
82
+ The mystikó gem is a modified Vernam cypher. The Vernam cypher works
83
+ by taking a stream of input symbols and mapping them to output symbols. This
84
+ mapping obscures the original data. The classic approach to this type of cypher
85
+ is to have a random string of data of the same length as the plain text data.
86
+ The two streams of data are combined using the XOR operation. To recover the
87
+ original data, the cypher data is again combined with the random data with the
88
+ XOR operation. After one use, the random data is never reused.
85
89
 
86
90
  This works because the XOR operator exhibits the following identity:
87
91
 
@@ -134,15 +138,20 @@ deal.
134
138
  #### The Scrambled Vernam Cypher
135
139
 
136
140
  To avoid the problems of the classical Vernam cypher, mystikó makes one
137
- significant change: The PRNG not only maps input symbols to output symbols, it
138
- also performs a controlled shuffle on those symbols.
141
+ significant change: The Scrambled Vernam Cypher first performs a PRNG
142
+ controlled shuffle on the symbols followed by a mapping of input symbols to
143
+ output symbols.
139
144
 
140
- To recover data, in addition to anti-mapping the symbols, we need to perform a
141
- controlled anti-shuffle of the data.
145
+ To recover data, the Scrambled Vernam Cypher decryption routine performs an
146
+ anti-mapping of the symbols back to their original values followed by a
147
+ controlled anti-shuffle of the data back to its original order.
142
148
 
143
149
  This data shuffling denies any would-be attacker knowledge of the order of the
144
150
  input data. Thus even with standard message headers, the content of the
145
- original message is no longer relevant.
151
+ original message is (hopefully) no longer relevant.
152
+
153
+ It remains to be seen if this is indeed the case. Comments, ideas,
154
+ observations, and thoughts are welcomed. See below for contributing.
146
155
 
147
156
  #### References
148
157
 
@@ -0,0 +1,10 @@
1
+ # The Mystikó Challenge
2
+
3
+ In this folder you will find the challenge.bin file. This file contains the
4
+ output of the mystico program. It is a encrypted version of a bit of text.
5
+
6
+ The **Challenge?** **Crack** the **Code**; **Recover** the **Data**; If you can!
7
+
8
+ Prizes? Well at present none beyond fame and notoriety. I will try and
9
+ see if I can find a sponsor for something a little better and will update
10
+ this note as more information and goodies become available.
Binary file
data/irbt.rb CHANGED
@@ -2,8 +2,6 @@
2
2
  # An IRB + mystiko test bed
3
3
 
4
4
  require 'irb'
5
- $force_alias_read_line_module = true
6
- require 'mini_readline'
7
5
 
8
6
  puts "Starting an IRB console with mystiko loaded."
9
7
 
@@ -2,5 +2,5 @@
2
2
 
3
3
  class Mystiko
4
4
  #The version of this encryption library.
5
- VERSION = "0.1.0"
5
+ VERSION = "0.1.1"
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mystiko
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Camilleri
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-14 00:00:00.000000000 Z
11
+ date: 2016-08-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fibonacci_rng
@@ -107,6 +107,8 @@ files:
107
107
  - LICENSE.txt
108
108
  - README.md
109
109
  - bin/mystiko
110
+ - challenge/README.md
111
+ - challenge/challenge.bin
110
112
  - irbt.rb
111
113
  - lib/mystiko.rb
112
114
  - lib/mystiko/decrypt.rb