Sha256: a0e0aa3d8b80bea32f982626f9360955aa2379d029359a114014ee2c24e1cc44

Contents?: true

Size: 1.76 KB

Versions: 1

Compression:

Stored size: 1.76 KB

Contents

# CryptoGost3411

GOST R 34.11-2012 (Stribog) digest algorithm

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'crypto_gost3411'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install crypto_gost3411

## Usage

```ruby
require 'crypto_gost3411'
include CryptoGost3411

# one-step digest 64 bytes
data1 = 'ruby'
digest64 = Gost3411.new(64).update(data1).final
puts 'data1 digest 64 bytes:'
digest64.unpack('H*')[0].scan(/.{16}/).each{|line| puts line}

# multipart digest 32 bytes
data2 = 'gost'
ctx = Gost3411.new(32)
ctx.update(data1)
ctx.update(data2)
digest32 = ctx.final
puts 'data1+data2 digest 32 bytes:'
digest32.unpack('H*')[0].scan(/.{16}/).each{|line| puts line}
```

## Results 
```
data1 digest 64 bytes:
e03cbcfe6843fc96
6607cdd67a77de22
38549548989e63eb
9a0d9690f3e468f8
c7a555c55decfbd5
aab8b99ea945de7d
50e717313125d033
015bbb54407f0d69
data1+data2 digest 32 bytes:
c0bf500c50d02096
97fdb8629c4bc3c1
24f294bcf346c905
112f0a8e1155917e
```
 
## Development

After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/vblazhnovgit/crypto_gost3411.

## License

The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
crypto_gost3411-0.1.7 README.md