encrypted_text 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +1 -42
- data/encrypted_text.gemspec +1 -1
- data/lib/encrypted_text/version.rb +1 -1
- metadata +18 -29
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: ade0241feb9cefb72dbf1e474a7c15d62f96ac98
|
4
|
+
data.tar.gz: f4035dfbeb68fccd6de79968281707edd306983c
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b4b3d57e42050e88d3780f502fe4ad84ffc13d0561ab2cb2d6b334db60ab25c2994f2c3c23d3b0f95b1f09d2536dbfbcd24224898d628166834eeaabd3a1052c
|
7
|
+
data.tar.gz: 44bf7499acfa8ca03a37f8393e11dfc8a276622c1add8a0f53f0c223545a6e26e4969ad492da654c7adb5b4d444f1f9b39474984c0e552dea75c5f72386a5087
|
data/README.md
CHANGED
@@ -1,42 +1 @@
|
|
1
|
-
|
2
|
-
==============
|
3
|
-
|
4
|
-
Password-based, two-way encryption with string output. Uses AES encryption.
|
5
|
-
|
6
|
-
Usage example
|
7
|
-
-------------
|
8
|
-
|
9
|
-
In order to encode or decode a message, you should know the **key** and **signature** ahead of time.
|
10
|
-
|
11
|
-
- The key is a 16-, 24-, or 32-character string, used as an AES encryption key.
|
12
|
-
- The signature is prepended to the message before encryption, and verified after decryption.
|
13
|
-
|
14
|
-
```ruby
|
15
|
-
require 'encrypted_text'
|
16
|
-
|
17
|
-
codec = EncryptedText.new(
|
18
|
-
:signature => '!@#$1234!@#$', # Should not resemble actual message content
|
19
|
-
:key => '0123456789ABCDEF' # Should be 16, 24, or 32 chars long
|
20
|
-
)
|
21
|
-
|
22
|
-
encoded = codec.encode("Hello, world!")
|
23
|
-
original_message = codec.decode(encoded)
|
24
|
-
```
|
25
|
-
|
26
|
-
You can also add a random salt, so that repeated encodings of the same message produce different results.
|
27
|
-
|
28
|
-
```ruby
|
29
|
-
# Continued from previous example
|
30
|
-
code.salt_size = 8
|
31
|
-
message = "Hello, world!"
|
32
|
-
|
33
|
-
a = codec.encode(message)
|
34
|
-
b = codec.encode(message) # Should be a different result!
|
35
|
-
```
|
36
|
-
|
37
|
-
Motivation
|
38
|
-
----------
|
39
|
-
|
40
|
-
Among other things, this library is useful for generating tokens that seem opaque to the outside world, but actually encode real information.
|
41
|
-
|
42
|
-
For example, in situations where tokens are passed from a service to an outside party and then back again, the service needs some way of resolving tokens passed back to it. Oftentimes this means performing a lookup on a stored mapping (e.g. a database query) between the token and some kind of cleartext data that outside parties never see. But this comes with all the clumsiness of maintaining and interacting with a persistent data store. For some applications, it might be acceptable simply to encode data directly into the token itself, using a secret that only the originating service has access to. EncryptedText provides a simple API to accomplish this.
|
1
|
+
**This library is old and insecure.** I suggest using [Ruby bindings for NaCl](https://github.com/cryptosphere/rbnacl) for any encryption-related needs.
|
data/encrypted_text.gemspec
CHANGED
@@ -4,7 +4,7 @@ require 'encrypted_text/version'
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |s|
|
6
6
|
s.name = 'encrypted_text'
|
7
|
-
s.summary = '
|
7
|
+
s.summary = 'This library is old and insecure. Do not use.'
|
8
8
|
s.description = s.summary
|
9
9
|
s.homepage = 'http://github.com/jeffomatic/encrypted_text'
|
10
10
|
s.version = EncryptedText::VERSION
|
metadata
CHANGED
@@ -1,88 +1,79 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: encrypted_text
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
5
|
-
prerelease:
|
4
|
+
version: 0.1.3
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Jeff Lee
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2015-03-12 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: fast-aes
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- - ~>
|
17
|
+
- - "~>"
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '0.1'
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- - ~>
|
24
|
+
- - "~>"
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '0.1'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: hex_string
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- - ~>
|
31
|
+
- - "~>"
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: '1.0'
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- - ~>
|
38
|
+
- - "~>"
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: '1.0'
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: radix
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- - ~>
|
45
|
+
- - "~>"
|
52
46
|
- !ruby/object:Gem::Version
|
53
47
|
version: 2.0.1
|
54
48
|
type: :runtime
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- - ~>
|
52
|
+
- - "~>"
|
60
53
|
- !ruby/object:Gem::Version
|
61
54
|
version: 2.0.1
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: rspec
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
|
-
- - ~>
|
59
|
+
- - "~>"
|
68
60
|
- !ruby/object:Gem::Version
|
69
61
|
version: 1.3.1
|
70
62
|
type: :development
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
|
-
- - ~>
|
66
|
+
- - "~>"
|
76
67
|
- !ruby/object:Gem::Version
|
77
68
|
version: 1.3.1
|
78
|
-
description:
|
69
|
+
description: This library is old and insecure. Do not use.
|
79
70
|
email:
|
80
71
|
- jeffomatic@gmail.com
|
81
72
|
executables: []
|
82
73
|
extensions: []
|
83
74
|
extra_rdoc_files: []
|
84
75
|
files:
|
85
|
-
- .gitignore
|
76
|
+
- ".gitignore"
|
86
77
|
- LICENSE
|
87
78
|
- README.md
|
88
79
|
- encrypted_text.gemspec
|
@@ -95,27 +86,25 @@ files:
|
|
95
86
|
- spec/support/codec_helper.rb
|
96
87
|
homepage: http://github.com/jeffomatic/encrypted_text
|
97
88
|
licenses: []
|
89
|
+
metadata: {}
|
98
90
|
post_install_message:
|
99
91
|
rdoc_options: []
|
100
92
|
require_paths:
|
101
93
|
- lib
|
102
94
|
required_ruby_version: !ruby/object:Gem::Requirement
|
103
|
-
none: false
|
104
95
|
requirements:
|
105
|
-
- -
|
96
|
+
- - ">="
|
106
97
|
- !ruby/object:Gem::Version
|
107
98
|
version: '0'
|
108
99
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
109
|
-
none: false
|
110
100
|
requirements:
|
111
|
-
- -
|
101
|
+
- - ">="
|
112
102
|
- !ruby/object:Gem::Version
|
113
103
|
version: '0'
|
114
104
|
requirements: []
|
115
105
|
rubyforge_project:
|
116
|
-
rubygems_version:
|
106
|
+
rubygems_version: 2.4.6
|
117
107
|
signing_key:
|
118
|
-
specification_version:
|
119
|
-
summary:
|
108
|
+
specification_version: 4
|
109
|
+
summary: This library is old and insecure. Do not use.
|
120
110
|
test_files: []
|
121
|
-
has_rdoc:
|