number_station 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 82023000e2e5b6c02f3c119d1a9d9681e2594fcc1521e85818b5c7ef3ed95a17
4
- data.tar.gz: c17efa2f646ae475071a5fd11b917d4bde773b5318edea431f035646dff96a64
3
+ metadata.gz: 377a40f8d4aaf4f86503a468bcbb133b10b738d4553e5da6849490150ce41b98
4
+ data.tar.gz: 0ba471edeabe6cee234897cc18913aacad818417c39bc5cbc7c5e639e7af6c1e
5
5
  SHA512:
6
- metadata.gz: 29895f2966c163aa1843000a654cd5c26da8fa12459e57ebada3b4d346d96aa4c1d352032f66e70eb611762793a18f640d7705c776e792d9abf68ab8b83b27f8
7
- data.tar.gz: 5fdb3a5c25fa486f2bf0b4c5c72ac176094a8ea3457796ad73eef69e68a37bf6a3b679f3d62b7eb8218577c9545d05dd6b2f33087fdbbaa669b18cfe78de16eb
6
+ metadata.gz: cd740ab71dc7da9f01d81e844c7a71fa6ba5afa6c02eb332f3eb995f71fe6b768617f73149c625b3d0e9d5f1833cc7d0221a66b8f9f13233eeca0b17f89246f8
7
+ data.tar.gz: 21d407d3f8db3aa68dfc81265235553d39f6474c96bbdc483960d31396043a12a3d724319b2fc80ccef5de7cbed4227a68847e00b71738d4daf8d17ce71f7ec9
data/README.asciidoc CHANGED
@@ -11,3 +11,8 @@ against master on this repo. For more information see _CONTRIBUTING.asciidoc_
11
11
  number_station is distributed under the GPL 3.0 licence. For more information see the _COPYING.asciidoc_
12
12
  file.
13
13
 
14
+ === Number Station Resources ===
15
+
16
+ - https://linuxcoffee.com/numbers/
17
+ - http://users.telenet.be/d.rijmenants/en/onetimepad.htm
18
+ - https://www.numbers-stations.com/
@@ -189,5 +189,14 @@ module NumberStation
189
189
  end
190
190
 
191
191
 
192
+ # version
193
+ desc "version", "Print the version of the Number Stations gem."
194
+ long_desc <<-VERSION_LONG_DESC
195
+ Prints the version of the Number Stations gem.
196
+ VERSION_LONG_DESC
197
+ def version()
198
+ NumberStation::ConfigReader.read_config()
199
+ NumberStation.log.debug "Version: #{NumberStation::VERSION}"
200
+ end
192
201
  end
193
202
  end
@@ -34,6 +34,10 @@ module NumberStation
34
34
  end
35
35
 
36
36
  crypto_hex_str = pad_data["pads"][pad_num]["key"]
37
+ if message.size > crypto_hex_str.size
38
+ NumberStation.log.error "Error: The message length is greater than pad length. Unable to continue decryption."
39
+ exit
40
+ end
37
41
  NumberStation.log.debug "message length less than pad length: #{message.size <= crypto_hex_str.size}"
38
42
 
39
43
  crypto_byte_array = crypto_hex_str.scan(/.{1}/).each_slice(2).map { |f, l| (Integer(f,16) << 4) + Integer(l,16) }
@@ -57,4 +61,4 @@ module NumberStation
57
61
  return decrypted_string
58
62
  end
59
63
 
60
- end
64
+ end
@@ -33,8 +33,15 @@ module NumberStation
33
33
  raise e
34
34
  end
35
35
 
36
+ crypto_hex_str = pad_data["pads"][pad_num]["key"]
37
+
38
+ if message.size > crypto_hex_str.size
39
+ NumberStation.log.error "Exception: message length is larger than pad length. Break the message into smaller parts."
40
+ exit
41
+ end
42
+ NumberStation.log.debug "message length less than pad length"
43
+
36
44
  unless pad_data["pads"][pad_num]["consumed"]
37
- crypto_hex_str = pad_data["pads"][pad_num]["key"]
38
45
  NumberStation.log.debug "Marking key as consumed"
39
46
  pad_data["pads"][pad_num]["epoch_date"] = Time.now.to_i
40
47
  pad_data["pads"][pad_num]["consumed"] = true
@@ -47,7 +54,6 @@ module NumberStation
47
54
  exit
48
55
  end
49
56
 
50
- NumberStation.log.debug "message length less than pad length: #{message.size <= crypto_hex_str.size}"
51
57
  crypto_byte_array = crypto_hex_str.scan(/.{1}/).each_slice(2).map { |f, l| (Integer(f,16) << 4) + Integer(l,16) }
52
58
 
53
59
  encrypted_byte_array = []
@@ -70,4 +76,4 @@ module NumberStation
70
76
  return encrypted_byte_str
71
77
  end
72
78
 
73
- end
79
+ end
@@ -20,5 +20,5 @@
20
20
  =end
21
21
 
22
22
  module NumberStation
23
- VERSION = "0.1.0"
23
+ VERSION = "0.1.1"
24
24
  end
@@ -26,7 +26,7 @@ require "number_station/version"
26
26
  Gem::Specification.new do |spec|
27
27
  spec.name = "number_station"
28
28
  spec.version = NumberStation::VERSION
29
- spec.date = "2018-10-23"
29
+ spec.date = "2018-11-29"
30
30
  spec.authors = ["David Kirwan"]
31
31
  spec.email = ["davidkirwanirl@gmail.com"]
32
32
  spec.license = "GPL 3.0"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: number_station
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
  - David Kirwan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-23 00:00:00.000000000 Z
11
+ date: 2018-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pastel
@@ -119,8 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
119
119
  - !ruby/object:Gem::Version
120
120
  version: '0'
121
121
  requirements: []
122
- rubyforge_project:
123
- rubygems_version: 2.7.7
122
+ rubygems_version: 3.0.3
124
123
  signing_key:
125
124
  specification_version: 4
126
125
  summary: "(WIP) Run your own number station!"