sym 2.6.0 → 2.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +32 -27
  3. data/lib/sym/version.rb +19 -22
  4. data/sym.gemspec +20 -7
  5. metadata +40 -25
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4f617e5a540da0d9f51124c4ba3f8affa335593b
4
- data.tar.gz: 5fe223d7450486ba4fc3b201bfb06311968f9963
3
+ metadata.gz: 632c170e04c0683202d0f555dc5c0a1605e9f358
4
+ data.tar.gz: 3ed88bd3e490657a665e69911698cdbcfb25db92
5
5
  SHA512:
6
- metadata.gz: c17e78d532c9f3edbb075e1e1936619a187244a0e514b5b7600d6b686103f43af99b1f949846c489860875cb750c255bda8792ce5892163f1d968cb7498677d7
7
- data.tar.gz: 4ae3a762791fcdf65417185ad0d0d3d9c85ef2d7b6db51cecd6d9ab4911768b125c10dba7e8815b92f9bb226230a92177cb309c0932253f5364b220b2ce4d687
6
+ metadata.gz: 044bdb0bbe730dae5399c11694fdc214c847217cc72c76df301fc14fb59b8cccb1aec7f7fd5da3e5ffa6d3a1c9cf2f426a1e4bff89429984407fa22dab1cb2c3
7
+ data.tar.gz: 26b4d27351d37ce6a9bb0eca94732cbb7d2a58501c65bd9a392380ea15aa45703e3ac754802a930cb712cfec4b637daccd5ff809ece85a16d2f54554409aa5dd
data/README.md CHANGED
@@ -244,45 +244,33 @@ You can encrypt the private key using a custom password. This is highly recommen
244
244
 
245
245
  For this purpose, two more instance methods exist:
246
246
 
247
- * `encr_password(data, password, iv = nil)`
248
- * `decr_password(encrypted_data, password, iv = nil)`
247
+ * `#encr_password(data, password, iv = nil)`
248
+ * `#decr_password(encrypted_data, password, iv = nil)`
249
249
 
250
250
  They can be used independently of `encr` and `decr` to encrypt/decrypt any data with a password.
251
251
 
252
- <a name="rubyapi-app"></a>
253
-
254
- ### `Sym::Application`
252
+ <a name="magic-file"></a>
255
253
 
256
- Since the command line interface offers much more than just encryption/decryption of data with a key, majority of these features are available through `Sym::Application` instance.
257
-
258
- The class is instantiated with a hash that would be otherwise generated by parsing CLI arguments, typical `options`. For example, to generate the key, pass `generate: true` — essentially any flag in it's long form can be converted into a hash member.
254
+ ### Using `Sym::MagicFile` API for Reading/Writing Encrypted/Decrypted data
259
255
 
260
- Here is an example:
261
-
262
- ```ruby
263
- require 'sym/application'
256
+ This is probably the easiest way to leverage Sym-encrypted files in your application — by loading them into memory with `Sym::MagicFile`. This class provides a very simple API while supporting all of the convenience features of the rich application API (see below).
264
257
 
265
- key = Sym::Application.new(generate: true).execute
266
- # => '75ngenJpB6zL47/8Wo7Ne6JN1pnOsqNEcIqblItpfg4='
267
- ```
268
-
269
- ### `Sym::MagicFile` for Reading Encrypted Data
270
-
271
- This is probably the easiest way to leverage Sym-encrypted files, by loading them into memory.
272
-
273
- `Sym::MagicFile` provides a very simple API for loading and reading encrypted files
274
- into memory, while supporting all of the convenience features of the rich
275
- application API.
276
-
277
- You initialize this class with just two things: a `pathname` to a file (encrypted
258
+ You instantiate `Sym::MagicFile` with just two parameters: a `pathname` to a file (encrypted
278
259
  or not), and the `key` identifier. The identifier can either be a filename, or
279
260
  OS-X Keychain entry, or environment variable name, etc — basically it is resolve
280
261
  like any other `-k <value>` CLI flag.
281
262
 
282
- #### Example: Using `Sym::MagicFile` with the `RailsConfig` gem
263
+ The following methods are available:
264
+
265
+ * `#encrypt` — returns an encrypted string representing the encrypted contents ofa file specified by the pathname.
266
+ * `#decrypt` — returns a decrypted string representing the decrypted contents of a file specified by the pathname.
267
+ * `#encrypt_to(filename)` — encrypts the contents of a file specified by the pathname, and writes the result to a `filename`.
268
+ * `#decrypt_to(filename)` — decrypts the contents of a file specified by the pathname, and writes the result to a `filename`.
269
+
270
+ #### Example: Using `Sym::MagicFile` with the `RailsConfig` (or `Settings`) gem
283
271
 
284
272
  In this example, we assume that the environment variable `$PRIVATE_KEY` contain
285
- the key to be used in decryption. Note that methods `#decrypt` and `#read` on `Sym::MagicFile` instance are synomymous.
273
+ the key to be used in decryption.
286
274
 
287
275
  ```ruby
288
276
  require 'sym/magic_file'
@@ -307,6 +295,23 @@ Settings.add_source!(
307
295
  Settings.reload!
308
296
  ```
309
297
 
298
+ <a name="rubyapi-app"></a>
299
+
300
+ ### Using `Sym::Application` API
301
+
302
+ Since the command line interface offers much more than just encryption/decryption of data with a key, majority of these features are available through `Sym::Application` instance.
303
+
304
+ The class is instantiated with a hash that would be otherwise generated by parsing CLI arguments, typical `options`. For example, to generate the key, pass `generate: true` — essentially any flag in it's long form can be converted into a hash member.
305
+
306
+ Here is an example:
307
+
308
+ ```ruby
309
+ require 'sym/application'
310
+
311
+ key = Sym::Application.new(generate: true).execute
312
+ # => '75ngenJpB6zL47/8Wo7Ne6JN1pnOsqNEcIqblItpfg4='
313
+ ```
314
+
310
315
  ### Ruby API Conclusion
311
316
 
312
317
  Using `Sym`'s rich ruby API you can perform both low-level encryption/decryption, as well as high-level management of encrypted files. By using `Sym::MagicFile` and/or `Sym::Application` classes you can access the entire set of functionality expressed vi the CLI, described in details below.
@@ -1,28 +1,25 @@
1
1
  module Sym
2
- VERSION = '2.6.0'
2
+ VERSION = '2.6.1'
3
3
  DESCRIPTION = <<-eof
4
- Sym is a command line utility plus a straightforward Ruby API that makes it easy to
5
- transparently handle sensitive data such as application secrets using symmetric
6
- encryption with a 256bit key.
7
-
8
- Unlike many modern encryption tools, sym focuses on the streamlined interface (CLI),
9
- and offers many time-saving features that make encryption/decryption of application
10
- secrets and other sensitive data as seamless as possible.
11
-
12
- You can encrypt the key itself with a password, for an additional layer of security.
13
- You can choose to save the key to OS-X Keychain, making it difficult to get the key
14
- when only disk is accessible. Using memcached or DRb sym can cache passwords so that
15
- you don't have to retype it too often. Finally, the -t flag (edit mode) decrypts
16
- the file on the fly, and lets you edit the unencrypted contents in $EDITOR.
4
+ ### Sym Symmetric Encryption Made Easy
5
+
6
+ **Sym** is a ruby library (gem) that offers both the command line interface (CLI) and a set of rich Ruby APIs, which make it rather trivial to add encryption and decryption of sensitive data to your development or deployment flow. As a layer of additional security, you can encrypt the private key itself with a password.
17
7
 
18
- Sym can read the key from many sources, including file, environment variable,
19
- keychain, or CLI argument — all of the above become arguments of -k flag: one
20
- flag to define the key no matter where it lives.
8
+ Unlike many other existing encryption tools, Sym focuses on getting out of the way by offering its streamlined interface, hoping to make encryption of application secrets nearly completely transparent to the developers.
21
9
 
22
- Finally, set environment variable SYM_ARGS to common flags you use, and then
23
- have sym read these flags, activating this time-saving feature with -A flag.
24
-
25
- Sym uses a symmetric aes-256-cbc cipher with a private key and an IV vector,
26
- and is built atop of OpenSSL.
10
+ For the data encryption Sym uses a symmetric 256-bit key with the `AES-256-CBC` cipher, same cipher as used by the US Government. For password-protecting the key Sym uses `AES-128-CBC` cipher. The resulting data is zlib-compressed and base64-encoded. The keys are also base64 encoded for easy copying/pasting/etc.
11
+
12
+ ### Massive Time Savers
13
+
14
+ Sym accomplishes encryption transparency by combining convenience features:
15
+
16
+ * Sym can read the private key from multiple source types, such as: a pathname to a file, an environment variable name, a keychain entry, or CLI argument. You simply pass either of these to the `-k` flag — one flag that works for all source types
17
+ * By utilizing OS-X Keychain on a Mac, Sym offers truly secure way of storing the key on a local machine, much more secure then storing it on a file system
18
+ * By using a local password cache (activated with `-c`) via an in-memory provider such as memcached or `drb`, sym invocations take advantage of password cache, and only ask for a password once per a configurable time period
19
+ * By using `SYM_ARGS` environment variable, where common flags can be saved. This is activated with `sym -A`
20
+ * By reading the key from the default key source file `~/.sym.key` which requires no flags at all
21
+ * By utilizing the `--negate` option to quickly encrypt a regular file, or decrypt an encrypted file with extension `.enc`
22
+ * By implementing the `-t` (edit) mode, that opens an encrypted file in your `$EDITOR`, and replaces the encrypted version upon save & exit, optionally creating a backup.
23
+ * By offering the `Sym::MagicFile` ruby API to easily read encrypted files into memory.
27
24
  eof
28
25
  end
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ['Konstantin Gredeskoul']
10
10
  spec.email = %w(kigster@gmail.com)
11
11
 
12
- spec.summary = %q{Super easy to use encryption library & a CLI with a strong aes-256-cbc cipher that can be used to transparently encrypt/decrypt/edit application secrets.}
12
+ spec.summary = %q{Dead-simple and easy to use encryption library on top of OpenSSL, offering rich Ruby API as well as feature-rich CLI able to generate a key, encrypt/decrypt data, password-protect the keys, cache passwords, and more. Strong cipher "aes-256-cbc" used by US Government is behind data encryption.}
13
13
 
14
14
  spec.description = Sym::DESCRIPTION
15
15
 
@@ -21,16 +21,29 @@ Gem::Specification.new do |spec|
21
21
  spec.require_paths = ['lib']
22
22
  spec.required_ruby_version = '>= 2.2'
23
23
  spec.post_install_message = <<-EOF
24
- Thank you for installing this gem! We hope you like it :)
25
24
 
26
- NOTE: To enable bash command line completion, please run the following
27
- command, which appends sym's shell completion to the file specified
28
- in arguments to -B/--bash-support flag.
25
+ Thank you for installing Sym!
26
+
27
+ BLOG POST
28
+ =========
29
+ http://kig.re/2017/03/10/dead-simple-encryption-with-sym.html
30
+
31
+ BASH COMPLETION
32
+ ===============
33
+ To enable bash command line completion, please run the following
34
+ command, which appends sym's shell completion wrapper to the file
35
+ specified in arguments to -B/--bash-support flag.
29
36
 
30
37
  sym -B ~/.bash_profile
38
+ source ~/.bash_profile
31
39
 
32
- Thank you for checking out Sym and happy crypting :)
33
- -- KG ( github.com/kigster | twitter.com/kig )
40
+ Thank you for using Sym and happy crypting :)
41
+
42
+ For bonus points, run 'symit -h' after installing and loading bash
43
+ completion.
44
+
45
+ @kigster on Github, @kig on Twitter.
46
+
34
47
  EOF
35
48
  spec.add_dependency 'colored2', '~> 3'
36
49
  spec.add_dependency 'slop', '~> 4.3'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sym
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.0
4
+ version: 2.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konstantin Gredeskoul
@@ -206,23 +206,34 @@ dependencies:
206
206
  - - ">="
207
207
  - !ruby/object:Gem::Version
208
208
  version: '0'
209
- description: " Sym is a command line utility plus a straightforward Ruby API that
210
- makes it easy to \n transparently handle sensitive data such as application secrets
211
- using symmetric\n encryption with a 256bit key.\n \n Unlike many modern encryption
212
- tools, sym focuses on the streamlined interface (CLI),\n and offers many time-saving
213
- features that make encryption/decryption of application\n secrets and other sensitive
214
- data as seamless as possible. \n \n You can encrypt the key itself with a password,
215
- for an additional layer of security.\n You can choose to save the key to OS-X
216
- Keychain, making it difficult to get the key\n when only disk is accessible.
217
- Using memcached or DRb sym can cache passwords so that\n you don't have to retype
218
- it too often. Finally, the -t flag (edit mode) decrypts\n the file on the fly,
219
- and lets you edit the unencrypted contents in $EDITOR. \n\n Sym can read the
220
- key from many sources, including file, environment variable, \n keychain, or
221
- CLI argument all of the above become arguments of -k flag: one \n flag to define
222
- the key no matter where it lives.\n\n Finally, set environment variable SYM_ARGS
223
- to common flags you use, and then\n have sym read these flags, activating this
224
- time-saving feature with -A flag. \n \n Sym uses a symmetric aes-256-cbc
225
- cipher with a private key and an IV vector, \n and is built atop of OpenSSL.\n"
209
+ description: "### Sym Symmetric Encryption Made Easy\n \n**Sym** is a ruby library
210
+ (gem) that offers both the command line interface (CLI) and a set of rich Ruby APIs,
211
+ which make it rather trivial to add encryption and decryption of sensitive data
212
+ to your development or deployment flow. As a layer of additional security, you can
213
+ encrypt the private key itself with a password. \n\nUnlike many other existing encryption
214
+ tools, Sym focuses on getting out of the way by offering its streamlined interface,
215
+ hoping to make encryption of application secrets nearly completely transparent to
216
+ the developers. \n\nFor the data encryption Sym uses a symmetric 256-bit key with
217
+ the `AES-256-CBC` cipher, same cipher as used by the US Government. For password-protecting
218
+ the key Sym uses `AES-128-CBC` cipher. The resulting data is zlib-compressed and
219
+ base64-encoded. The keys are also base64 encoded for easy copying/pasting/etc.\n
220
+ \ \n### Massive Time Savers\n\nSym accomplishes encryption transparency by combining
221
+ convenience features:\n\n * Sym can read the private key from multiple source types,
222
+ such as: a pathname to a file, an environment variable name, a keychain entry, or
223
+ CLI argument. You simply pass either of these to the `-k` flag — one flag that works
224
+ for all source types\n * By utilizing OS-X Keychain on a Mac, Sym offers truly secure
225
+ way of storing the key on a local machine, much more secure then storing it on a
226
+ file system\n * By using a local password cache (activated with `-c`) via an in-memory
227
+ provider such as memcached or `drb`, sym invocations take advantage of password
228
+ cache, and only ask for a password once per a configurable time period\n * By using
229
+ `SYM_ARGS` environment variable, where common flags can be saved. This is activated
230
+ with `sym -A`\n * By reading the key from the default key source file `~/.sym.key`
231
+ which requires no flags at all\n * By utilizing the `--negate` option to quickly
232
+ encrypt a regular file, or decrypt an encrypted file with extension `.enc`\n * By
233
+ implementing the `-t` (edit) mode, that opens an encrypted file in your `$EDITOR`,
234
+ and replaces the encrypted version upon save & exit, optionally creating a backup.\n
235
+ * By offering the `Sym::MagicFile` ruby API to easily read encrypted files into
236
+ memory.\n"
226
237
  email:
227
238
  - kigster@gmail.com
228
239
  executables:
@@ -306,11 +317,13 @@ files:
306
317
  homepage: https://github.com/kigster/sym
307
318
  licenses: []
308
319
  metadata: {}
309
- post_install_message: "Thank you for installing this gem! We hope you like it :) \n\nNOTE:
310
- To enable bash command line completion, please run the following \ncommand, which
311
- appends sym's shell completion to the file specified\nin arguments to -B/--bash-support
312
- flag.\n\n sym -B ~/.bash_profile\n \nThank you for checking out Sym and happy crypting
313
- :)\n -- KG ( github.com/kigster | twitter.com/kig )\n"
320
+ post_install_message: "\nThank you for installing Sym! \n\nBLOG POST\n=========\nhttp://kig.re/2017/03/10/dead-simple-encryption-with-sym.html\n\nBASH
321
+ COMPLETION\n===============\nTo enable bash command line completion, please run
322
+ the following \ncommand, which appends sym's shell completion wrapper to the file
323
+ \nspecified in arguments to -B/--bash-support flag.\n\n sym -B ~/.bash_profile\n
324
+ \ source ~/.bash_profile\n \nThank you for using Sym and happy crypting :)\n\nFor
325
+ bonus points, run 'symit -h' after installing and loading bash\ncompletion.\n\n@kigster
326
+ on Github, @kig on Twitter.\n\n"
314
327
  rdoc_options: []
315
328
  require_paths:
316
329
  - lib
@@ -329,6 +342,8 @@ rubyforge_project:
329
342
  rubygems_version: 2.5.2
330
343
  signing_key:
331
344
  specification_version: 4
332
- summary: Super easy to use encryption library & a CLI with a strong aes-256-cbc cipher
333
- that can be used to transparently encrypt/decrypt/edit application secrets.
345
+ summary: Dead-simple and easy to use encryption library on top of OpenSSL, offering
346
+ rich Ruby API as well as feature-rich CLI able to generate a key, encrypt/decrypt
347
+ data, password-protect the keys, cache passwords, and more. Strong cipher "aes-256-cbc"
348
+ used by US Government is behind data encryption.
334
349
  test_files: []