Project

kingdom

0.0
The project is in a healthy, maintained state
Encrypt and Decrypt Strings with keys (to the kingdom)
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Runtime

>= 0
>= 0
 Project Readme

Kingdom

Simple ruby ssl encrypting, decrypting, signing, and validation.

Installation

bundle add kingdom
gem install kingdom

Usage

require "kingdom"
# ssl key size can be changed (default 1042)
#  Kingdom.size 4096
#  Kingdom.size 512
#
# user's kingdom
@king = Kingdom['user id']
# if new, peek at the newly created key accordingly.
@king.peek { |k| @key = k }
@key = @king.peek
# set user's key
@king.key = @key
# if necessary, you can match the private key
@king.private?(@key) ? "match" : "no"
# encrypt plaintext
@encrypted = @king << "plaintext"
# decrypt encrypted text
@decrypted = @king[@encrypted] #=> "plaintext"
# sign plaintext
@signature = @king.sign(@plain)
# verify signature of plaintext
@king.sign?(@signature, @plain) #=> true