https://github.com/dkam/hsmr
HSM Functions in Ruby
https://github.com/dkam/hsmr
hsm ruby
Last synced: about 1 month ago
JSON representation
HSM Functions in Ruby
- Host: GitHub
- URL: https://github.com/dkam/hsmr
- Owner: dkam
- License: mit
- Created: 2011-01-07T11:12:05.000Z (over 14 years ago)
- Default Branch: main
- Last Pushed: 2023-03-17T05:28:41.000Z (about 2 years ago)
- Last Synced: 2025-04-23T23:15:53.220Z (about 1 month ago)
- Topics: hsm, ruby
- Language: Ruby
- Size: 33.2 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
README
HSMR [](http://travis-ci.org/dkam/hsmr)
===========HSMR is a collection of cryptographic commands usually implemented on a HSM (Hardware Security Module). These
are implemented for your education or for testing purposes and should not be used to replace an actual HSM.Installation
-------------gem install hsmr
Usage
---------require 'hsmr'
# Create a Key
> key=HSMR::Key.new("4CA2161637D0133E5E151AEA45DA2A12")
=> 4CA2 1616 37D0 133E 5E15 1AEA 45DA 2A12
> key.key
=> "L\xA2\x16\x167\xD0\x13>^\x15\x1A\xEAE\xDA*\x12"
> key.to_s
=> "4CA2 1616 37D0 133E 5E15 1AEA 45DA 2A12"
> key.kcv
=> "7B0898"
> key.parity
=> "odd"
# Generate a PVVpan="5999997890123412"
pin="1234"
pvki="1"
pvv = HSMR.pvv(key, pan, pvki, pin)
=> "0798"Features
---------* Key / Componet features
* Create Keys and Components
* XOR Keys and Components together
* Find Key Check Values (kcv)
* Determine and change key parity
* Encrypt / Decrypt PIN Blocks
* Generate IBM3624 PINs
* Generate PVV, CVV & CVV2 valuesDevelopment
-----------* Source hosted on GitHub.
* Report issues on GitHub Issues.
* Pull requests are awesome! Please include test::unit testsLicense
-------The gem is available as open source under the terms of the MIT License.