dekryptos 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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -0
  3. data/bin/dekrypt +27 -17
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 593f93ec638be132440da71be3eb1374943a24c3
4
- data.tar.gz: 7ed51ee4afe57848bb12b4ec27ddcd3e5fe30ffe
3
+ metadata.gz: e65e1262cc07b1f11d36f89337c167c05d02d1a0
4
+ data.tar.gz: ed7c3f349c95200575fe02945fa05dc6b45dbbe6
5
5
  SHA512:
6
- metadata.gz: 333bc3c6fc65dc198f060c30e5f5c0dc69cd315c8d6f8880a2a79ed6fbd3572fa2ab748c9e5ebec56807c2405431a4e388abaec7b95b57db532f2d3bbd7b3477
7
- data.tar.gz: 16b3b9da8896ba425ed72a51e841b89df3411218d858bfb205b33dc164d50c5865cc46a4c250af2e84f224b5001dbbed3a2388950cd4306093691491d2ad84a2
6
+ metadata.gz: d23df50c10ed4840d013f9418a38dd09b0835e37c2fc6dee63b90ccf765675f18d50bb1878de53a716c655893fb88d3a61ecc8bc660283f5fbb28e94c53f4490
7
+ data.tar.gz: 6dae99a92056ba28eb541c67c664061d54448ec44ca2c5c09576ef66e48ee608f376f22367f0c842c64d4321609dc27a3311e4ac1bb726f9f12ccd1301ab1770
data/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  D E K Я Y P T O S
2
2
  ===================
3
3
 
4
+ [![Build Status](https://travis-ci.org/ericqweinstein/dekryptos.svg)](https://travis-ci.org/ericqweinstein/dekryptos)
5
+
4
6
  ## About
5
7
  These are little bits o' Ruby magic I've been using to mess around with decrypting parts of the [Kryptos sculpture](http://en.wikipedia.org/wiki/Kryptos).
6
8
 
@@ -15,6 +17,7 @@ $ gem install dekryptos
15
17
  ## Examples
16
18
  ```bash
17
19
  $ dekrypt -t EMUFPHZLRFAXYUSDJKZLDKRNSHGNFIVJYQTQUXQBQVYUVLLTREVJYQTMKYRDMFD -k KRYPTOS,PALIMPSEST -c vigenere
20
+
18
21
  BETWEENSUBTLESHADINGANDTHEABSENCEOFLIGHTLIESTHENUANCEOFIQLUSION
19
22
 
20
23
  $ dekrypt -t VFPJUDEEHZWETZYVGWHKKQETGFQJNCEGGWHKK?DQMCPFQZDQMMIAGPFXHQRLGTIMVMZJANQLVKQEDAGDVFRPJUNGEUNAQZGZLECGYUXUEENJTBJLBQCRTBJDFHRRYIZETKZEMVDUFKSJHKFWHKUWQLSZFTIHHDDDUVH?DWKBFUFPWNTDFIYCUQZEREEVLDKFEZMOQQJLTTUGSYQPFEUNLAVIDXFLGGTEZ?FKZBSFDQVGOGIPUFXHHDRKFFHQNTGPUAECNUVPDJMQCLQUMUNEDFQELZZVRRGKFFVOEEXBDMVPNFQXEZLGREDNQFMPNZGLFLPMRJQYALMGNUVPDXVKPDQUMEBEDMHDAFMJGZNUPLGESWJLLAETG -k KRYPTOS,ABSCISSA -c vigenere
@@ -27,6 +27,9 @@ class Dekrypt
27
27
  opts.separator ' Supported ciphers: autokey, monoalphabetic, playfair,'
28
28
  opts.separator ' transposition, vigenere.'
29
29
  opts.separator ''
30
+ opts.separator 'You may also retrieve parts of the sculpture'
31
+ opts.separator 'ciphertext by name, e.g. dekrypt -K1'
32
+ opts.separator ''
30
33
 
31
34
  opts.on('-h', '--help', 'Display this screen') do
32
35
  puts opt_parser
@@ -44,27 +47,34 @@ class Dekrypt
44
47
  opts.on('-c c', '--cipher c', String, 'Enter cipher name') do |cipher|
45
48
  options.cipher = cipher
46
49
  end
50
+
51
+ opts.on('-Kn', String, 'Select Kryptos ciphertext segment') do |n|
52
+ self.class.send(:include, Kryptos)
53
+ puts Object.const_get("Kryptos::K#{n}")
54
+ end
47
55
  end
48
56
 
49
57
  begin opt_parser.parse!(args)
50
- cipher = options.cipher.capitalize
51
- self.class.send(:include, Object.const_get(cipher))
58
+ if options.cipher
59
+ cipher = options.cipher.capitalize
60
+ self.class.send(:include, Object.const_get(cipher))
52
61
 
53
- case cipher
54
- when 'Autokey'
55
- puts decrypt(options.text, build_tabula_recta, options.keys.first)
56
- when 'Monoalphabetic'
57
- puts rot_13(options.text)
58
- when 'Playfair'
59
- puts decrypt(options.text, build_table(options.keys.first))
60
- when 'Transposition'
61
- puts decrypt(options.text, options.keys.first.to_i)
62
- when 'Vigenere'
63
- key_one = options.keys.first
64
- key_two = options.keys.last
65
- puts decrypt(options.text, build_table(key_one, key_two), key_two)
66
- else
67
- fail "[!] Unknown cipher: #{options.cipher}"
62
+ case cipher
63
+ when 'Autokey'
64
+ puts decrypt(options.text, build_tabula_recta, options.keys.first)
65
+ when 'Monoalphabetic'
66
+ puts rot_13(options.text)
67
+ when 'Playfair'
68
+ puts decrypt(options.text, build_table(options.keys.first))
69
+ when 'Transposition'
70
+ puts decrypt(options.text, options.keys.first.to_i)
71
+ when 'Vigenere'
72
+ key_one = options.keys.first
73
+ key_two = options.keys.last
74
+ puts decrypt(options.text, build_table(key_one, key_two), key_two)
75
+ else
76
+ fail "[!] Unknown cipher: #{options.cipher}"
77
+ end
68
78
  end
69
79
  rescue => e
70
80
  msg = "[!] An error occurred: #{e.message}\n"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dekryptos
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
  - Eric Weinstein