openssl-ccm 1.0.0 → 1.1.0
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 +4 -4
- data/README.md +31 -2
- data/lib/openssl/ccm.rb +2 -2
- data/lib/openssl/ccm/version.rb +1 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 92a532b59b054ccfe21e829d38c498d8ba7bfd89
|
4
|
+
data.tar.gz: 3dce973fb8819b77169e896a3aaeb73854d0f074
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 65a1cb1f4da10606b442551fbec24981c508ce7466b203e931d692e4bfc90e474e15d3e99a24ca0f805efa122d9ccc2ec477b108fa05ceaade01305202d3f198
|
7
|
+
data.tar.gz: a05d1e9b346e0ed7487d3972da57257b91741de4ab8f453f09cd2c0c51099e62c4118933f9689a53ba5dc97a2ac2acf6f9c55f84f71067563892f481d111be2c
|
data/README.md
CHANGED
@@ -1,4 +1,33 @@
|
|
1
|
-
openssl-ccm
|
2
|
-
===========
|
1
|
+
# openssl-ccm
|
3
2
|
|
4
3
|
Ruby Gem for RFC 3610 - Counter with CBC-MAC (CCM)
|
4
|
+
|
5
|
+
Abstract from tools.ietf.org/html/rfc3610: Counter with CBC-MAC (CCM) is a generic authenticated encryption block cipher mode. CCM is defined for use with 128-bit block ciphers, such as the Advanced Encryption Standard (AES).
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
gem 'openssl-ccm'
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install openssl-ccm
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
Example:
|
24
|
+
|
25
|
+
require 'openssl/ccm'
|
26
|
+
|
27
|
+
ccm = OpenSSL::CCM.new('AES', 'My16Byte LongKey', 8)
|
28
|
+
|
29
|
+
ciphertext = ccm.encrypt('The message to encrypt', 'The nonce')
|
30
|
+
|
31
|
+
plaintext = ccm.decrypt(ciphertext, 'The nonce')
|
32
|
+
|
33
|
+
After initialisation, you can use the object as often you need.
|
data/lib/openssl/ccm.rb
CHANGED
@@ -12,14 +12,14 @@ module OpenSSL
|
|
12
12
|
# ciphers, such as the Advanced Encryption Standard (AES).
|
13
13
|
#
|
14
14
|
# At the moment there is no update function, because length of
|
15
|
-
# data and additional_data are needed
|
15
|
+
# data and additional_data are needed at the begin of cipher process.
|
16
16
|
# In future init(nonce, data_len, additional_data_len) could
|
17
17
|
# be a solution, to solve this problem. After init, update(data)
|
18
18
|
# could be used to set additional_data first followed by data.
|
19
19
|
class CCM
|
20
20
|
# Searches for supported algorithms within OpenSSL
|
21
21
|
#
|
22
|
-
# @return [
|
22
|
+
# @return [[String]] supported algorithms
|
23
23
|
def self.ciphers
|
24
24
|
l = OpenSSL::Cipher.ciphers.keep_if { |c| c.end_with?('-128-CBC') }
|
25
25
|
l.length.times { |i| l[i] = l[i][0..-9] }
|
data/lib/openssl/ccm/version.rb
CHANGED