{-: rooto:"YARD::CodeObjects::RootObject:@childrenIC:&YARD::CodeObjects::CodeObjectList[o:$YARD::CodeObjects::ModuleObject;IC;[o:#YARD::CodeObjects::ClassObject;IC;[ o; ;IC;[ o:$YARD::CodeObjects::MethodObject: @scope: class:@visibility: public: @pathI"%Gibberish::RSA::KeyPair.generate:EF:@parameters[[" bits" 2048: @files[[I"lib/gibberish/rsa.rb;Ti*:@current_file_has_commentsF: @name: generate:@source_type: ruby: @tags[:@docstringIC:YARD::Docstring" ;F: @object@: @summary0:@hash_flagF:@ref_tags[;[: @allI";F:@line_range0:@namespace@ : @sourceI"Sdef self.generate(bits=2048) self.new(OpenSSL::PKey::RSA.generate(bits)) end;F:@signatureI"def generate(.);F:@explicitT: @dynamicTo; ; : instance;;;I"'Gibberish::RSA::KeyPair#passphrase;F;[;[[@i.;F;:passphrase;;;[;IC;".Returns the value of attribute passphrase ;F;@;0;F;[;[; I".Returns the value of attribute passphrase;F;!0;"@ ;#I"%def passphrase @passphrase end;F;$I"def passphrase;F;&T:@docstring_extra0o; ; ;';;;I"(Gibberish::RSA::KeyPair#passphrase=;F;[[I" value;F0;[[@i.;F;:passphrase=;;;[;IC;""Sets the attribute passphrase ;F;@*;0;F;[;[o:YARD::Tags::Tag :@tag_nameI" param;F: @textI"2the value to set the attribute passphrase to.;F;I" value;F: @types0;@*; I"]Sets the attribute passphrase @param value the value to set the attribute passphrase to.;F;!0;"@ ;#I"5def passphrase=(value) @passphrase = value end;F;$I"def passphrase=(value);F;&T;)0o; ; ;';;;I"'Gibberish::RSA::KeyPair#initialize;F;[["key0;[[@i0;F;:initialize;;;[;IC;" ;F;@<;0;F;[;[o;+ ;,I" return;F;-I"a new instance of KeyPair;F;0;.[I" KeyPair;F;@<; I";F;!0;"@ ;#I"adef initialize(key) @key = key @cipher = OpenSSL::Cipher::Cipher.new('aes-256-cbc') end;F;$I"def initialize(key);F;%T;&To; ; ;';;;I"'Gibberish::RSA::KeyPair#public_key;F;[;[[@i5;F;:public_key;;;[;IC;" ;F;@O;0;F;[;[; I";F;!0;"@ ;#I")def public_key @key.public_key end;F;$I"def public_key( );F;%T;&To; ; ;';;;I"(Gibberish::RSA::KeyPair#private_key;F;[;[[@i9;F;:private_key;;;[;IC;" ;F;@[;0;F;[;[; I";F;!0;"@ ;#I"ldef private_key if @passphrase @key.to_pem(@cipher, @passphrase) else @key.to_pem end end;F;$I"def private_key( );F;%T;&To; ; ;';;;I"!Gibberish::RSA::KeyPair#to_s;F;[;[[@iA;F;: to_s;;;[;IC;" ;F;@g;0;F;[;[; I";F;!0;"@ ;#I"def to_s private_key end;F;$I"def to_s( );F;%T;&T: @owner@ :@class_mixinsIC;[;3@ :@instance_mixinsIC;[;3@ :@attributesIC:SymbolHash{; IC;7{:@symbolize_valueT;'IC;7{;(IC;7{: read@: write@*;8T;8T;8T: @aliases{: @groups[;[[@i);F;: KeyPair;;;;;[;IC;" ;F;@ ;0;F;[;[; I";F;!0;"@ ;I"Gibberish::RSA::KeyPair;F:@superclasso:YARD::CodeObjects::Proxy : @imethod0:@origname0:@orignamespace0;: Object;"@: @obj0;&To; ; ; ;;;I"$Gibberish::RSA.generate_keypair;F;[[" bits" 2048;[[@iJ;T;:generate_keypair;;;[;IC;"4Generate an RSA keypair - defaults to 2048 bits ;F;@;0;F;[;[o;+ ;,I" param;F;-0;I" bits;F;.[I" Integer;F;@; I"KGenerate an RSA keypair - defaults to 2048 bits @param [Integer] bits;F;!o: Range: exclF: beginiG:endiI;"@ ;#I"Edef RSA.generate_keypair(bits=2048) KeyPair.generate(bits) end;F;$I"def generate_keypair(.);F;%T;&T;)0o; ; ;';;;I"Gibberish::RSA#initialize;F;[["key0["passphrase"nil;[[@iS;T;;/;;;[;IC;"(Expects a public key at the minumum ;F;@;0;F;[;[o;+ ;,I" param;F;-I"public or private;F;I"key;F;.[I" #to_s;F;@o;+ ;,I" param;F;-I" to key;F;I"passphrase;F;.[I" String;F;@o;+ ;,I" return;F;-I"a new instance of RSA;F;0;.[I"RSA;F;@; I"qExpects a public key at the minumum @param [#to_s] key public or private @param [String] passphrase to key ;F;!o;F;GF;HiN;IiR;"@ ;#I"bdef initialize(key, passphrase=nil) @key = OpenSSL::PKey::RSA.new(key.to_s, passphrase) end;F;$I"(def initialize(key, passphrase=nil);F;%T;&T;)0o; ; ;';;;I"Gibberish::RSA#encrypt;F;[[" data0[" opts"{};[[@i\;T;: encrypt;;;[;IC;"Encrypt data using the key ;F;@;0;F;[;[o;+ ;,I" param;F;-0;I" data;F;.[I" #to_s;F;@o;+ ;,I" param;F;-0;I" opts;F;.[I" Hash;F;@o:YARD::Tags::OptionTag ;,I" option;F;-0;I" opts;F;.0: @pairo:YARD::Tags::DefaultTag ;,I" option;F;-I"*encode the data in binary, not Base64;F;I" :binary;F;.[I" Boolean;F:@defaults[I" false;F;@; I"Encrypt data using the key @param [#to_s] data @param [Hash] opts @option opts [Boolean] :binary (false) encode the data in binary, not Base64;F;!o;F;GF;HiW;Ii[;"@ ;#I"def encrypt(data, opts={}) data = data.to_s enc = @key.public_encrypt(data) if opts[:binary] enc else Base64.encode64(enc) end end;F;$I"def encrypt(data, opts={});F;%T;&T;)0o; ; ;';;;I"Gibberish::RSA#decrypt;F;[[" data0[" opts"{};[[@ik;T;: decrypt;;;[;IC;"Decrypt data using the key ;F;@;0;F;[;[o;+ ;,I" param;F;-0;I" data;F;.[I" #to_s;F;@o;+ ;,I" param;F;-0;I" opts;F;.[I" Hash;F;@o;K ;,I" option;F;-0;I" opts;F;.0;Lo;M ;,I" option;F;-I"$don't decode the data as Base64;F;I" :binary;F;.[I" Boolean;F;N[I" false;F;@; I"Decrypt data using the key @param [#to_s] data @param [Hash] opts @option opts [Boolean] :binary (false) don't decode the data as Base64;F;!o;F;GF;Hif;Iij;"@ ;#I"def decrypt(data, opts={}) data = data.to_s raise "No private key set!" unless @key.private? unless opts[:binary] data = Base64.decode64(data) end @key.private_decrypt(data) end;F;$I"def decrypt(data, opts={});F;%T;&T;)0;3@ ;4IC;[;3@ ;5IC;[;3@ ;6IC;7{; IC;7{;8T;'IC;7{;8T;8T;;{;<[;[[@i(;T;:RSA;;;;;[;IC;"oThis wraps the OpenSSL RSA functions Simply instantiate with a public key or private key cipher = Gibberish::RSA.new(private_key) enc = cipher.encrypt(data) dec = cipher.decrypt(enc) cipher = Gibberish::RSA(public_key) cipher.decrypt(enc) You can also generate a keypair using Gibberish::RSA.generate_keypair kp = Gibberish::RSA.generate_keypair(4096) kp.public_key #=> Outputs a Base64 encoded public key kp.private_key #=> Outputs the Base64 pem KeyPair will hand back the private key when passed to the RSA class. cipher = Gibberish::RSA.new(kp) ## OpenSSL CLI Interop openssl rsautl -decrypt -inkey [pem_file] -in [BinaryEncodedCryptedFile] or if you're using the default base64 output, you'll need to decode that first openssl enc -d -base64 -in [gibberish.crypted] | \ openssl rsautl -decrypt -inkey [pem_file] ;F;@ ;0;F;[;[; I"pThis wraps the OpenSSL RSA functions Simply instantiate with a public key or private key cipher = Gibberish::RSA.new(private_key) enc = cipher.encrypt(data) dec = cipher.decrypt(enc) cipher = Gibberish::RSA(public_key) cipher.decrypt(enc) You can also generate a keypair using Gibberish::RSA.generate_keypair kp = Gibberish::RSA.generate_keypair(4096) kp.public_key #=> Outputs a Base64 encoded public key kp.private_key #=> Outputs the Base64 pem KeyPair will hand back the private key when passed to the RSA class. cipher = Gibberish::RSA.new(kp) ## OpenSSL CLI Interop openssl rsautl -decrypt -inkey [pem_file] -in [BinaryEncodedCryptedFile] or if you're using the default base64 output, you'll need to decode that first openssl enc -d -base64 -in [gibberish.crypted] | \ openssl rsautl -decrypt -inkey [pem_file] ;F;!o;F;GF;Hi;Ii&;"@;I"Gibberish::RSA;F;>o;? ;@0;A0;B0;;C;"@;D0;)0;&To; ;IC;[o; ; ;';;;I"Gibberish::AES#password;F;[;[[I"lib/gibberish/aes.rb;Ti!;F;: password;;;[;IC;",Returns the value of attribute password ;F;@;0;F;[;[; I",Returns the value of attribute password;F;!0;"@;#I"!def password @password end;F;$I"def password;F;&T;)0o; ; ;';;;I"Gibberish::AES#size;F;[;[[@i!;F;: size;;;[;IC;"(Returns the value of attribute size ;F;@%;0;F;[;[; I"(Returns the value of attribute size;F;!0;"@;#I"def size @size end;F;$I" def size;F;&T;)0o; ; ;';;;I"Gibberish::AES#cipher;F;[;[[@i!;F;: cipher;;;[;IC;"*Returns the value of attribute cipher ;F;@1;0;F;[;[; I"*Returns the value of attribute cipher;F;!0;"@;#I"def cipher @cipher end;F;$I"def cipher;F;&T;)0o; ; ;';;;I"Gibberish::AES#initialize;F;[[" password0[" size"256;[[@i';T;;/;;;[;IC;"!Initialize with the password ;F;@=;0;F;[;[o;+ ;,I" param;F;-0;I" password;F;.[I" String;F;@=o;+ ;,I" param;F;-0;I" size;F;.[I" Integer;F;@=o;+ ;,I" return;F;-I"a new instance of AES;F;0;.[I"AES;F;@=; I"QInitialize with the password @param [String] password @param [Integer] size;F;!o;F;GF;Hi#;Ii&;"@;#I"def initialize(password, size=256) @password = password @size = size @cipher = OpenSSL::Cipher::Cipher.new("aes-#{size}-cbc") end;F;$I"'def initialize(password, size=256);F;%T;&T;)0o; ; ;';;;I"Gibberish::AES#encrypt;F;[[" data0[" opts"{};[[@i-;F;;J;;;[;IC;" ;F;@^;0;F;[;[; I";F;!0;"@;#I"def encrypt(data, opts={}) salt = generate_salt setup_cipher(:encrypt, salt) e = cipher.update(data) + cipher.final e = "Salted__#{salt}#{e}" #OpenSSL compatible if opts[:binary] e else Base64.encode64(e) end end;F;$I"def encrypt(data, opts={});F;%T;&To; ; ;';;;I"Gibberish::AES#enc;F;[;[[@i8;F;:enc;;;[;IC;" ;F;@o;0;F;[;[; I" ;F;"@;#I"def encrypt(data, opts={}) salt = generate_salt setup_cipher(:encrypt, salt) e = cipher.update(data) + cipher.final e = "Salted__#{salt}#{e}" #OpenSSL compatible if opts[:binary] e else Base64.encode64(e) end end;F;$@n;&T;)0: @linei8o; ; ;';;;I"Gibberish::AES#e;F;[;[[@i9;F;:e;;;[;IC;" ;F;@z;0;F;[;[; I" ;F;"@;#I"def encrypt(data, opts={}) salt = generate_salt setup_cipher(:encrypt, salt) e = cipher.update(data) + cipher.final e = "Salted__#{salt}#{e}" #OpenSSL compatible if opts[:binary] e else Base64.encode64(e) end end;F;$@n;&T;)0;Ui9o; ; ;';;;I"Gibberish::AES#decrypt;F;[[" data0[" opts"{};[[@i;;F;;O;;;[;IC;" ;F;@;0;F;[;[; I";F;!0;"@;#I"def decrypt(data, opts={}) data = Base64.decode64(data) salt = data[8..15] data = data[16..-1] setup_cipher(:decrypt, salt) cipher.update(data) + cipher.final end;F;$I"def decrypt(data, opts={});F;%T;&To; ; ;';;;I"Gibberish::AES#dec;F;[;[[@iB;F;:dec;;;[;IC;" ;F;@;0;F;[;[; I" ;F;"@;#I"def decrypt(data, opts={}) data = Base64.decode64(data) salt = data[8..15] data = data[16..-1] setup_cipher(:decrypt, salt) cipher.update(data) + cipher.final end;F;$@;&T;)0;UiBo; ; ;';;;I"Gibberish::AES#d;F;[;[[@iC;F;:d;;;[;IC;" ;F;@;0;F;[;[; I" ;F;"@;#I"def decrypt(data, opts={}) data = Base64.decode64(data) salt = data[8..15] data = data[16..-1] setup_cipher(:decrypt, salt) cipher.update(data) + cipher.final end;F;$@;&T;)0;UiCo; ; ;';: private;I"!Gibberish::AES#generate_salt;F;[;[[@iG;F;:generate_salt;;;[;IC;" ;F;@;0;F;[;[; I";F;!0;"@;#I"Fdef generate_salt s = '' 8.times {s << rand(255).chr} s end;F;$I"def generate_salt( );F;%T;&To; ; ;';;Y;I" Gibberish::AES#setup_cipher;F;[[" method0[" salt0;[[@iM;F;:setup_cipher;;;[;IC;" ;F;@;0;F;[;[; I";F;!0;"@;#I"hdef setup_cipher(method, salt) cipher.send(method) cipher.pkcs5_keyivgen(password, salt, 1) end;F;$I"#def setup_cipher(method, salt);F;%T;&T;3@;4IC;[;3@;5IC;[;3@;6IC;7{; IC;7{;8T;'IC;7{;QIC;7{;9@;:0;8T;RIC;7{;9@%;:0;8T;SIC;7{;9@1;:0;8T;8T;8T;;{ @o;J@z;J@;O@;O;<[;[[@i;T;:AES;;;;;[;IC;"gHandles AES encryption and decryption in a way that is compatible with OpenSSL. Defaults to 256-bit CBC encryption, ideally you should leave it this way ## Basic Usage ### Encrypting cipher = Gibberish::AES.new('p4ssw0rd') cipher.encrypt("some secret text") #=> "U2FsdGVkX1/D7z2azGmmQELbMNJV/n9T/9j2iBPy2AM=\n" ### Decrypting cipher = Gibberish::AES.new('p4ssw0rd') cipher.decrypt(""U2FsdGVkX1/D7z2azGmmQELbMNJV/n9T/9j2iBPy2AM=\n"") #=> "some secret text" ## OpenSSL Interop echo "U2FsdGVkX1/D7z2azGmmQELbMNJV/n9T/9j2iBPy2AM=\n" | openssl enc -d -aes-256-cbc -a -k p4ssw0rd ;F;@;0;F;[;[; I"j Handles AES encryption and decryption in a way that is compatible with OpenSSL. Defaults to 256-bit CBC encryption, ideally you should leave it this way ## Basic Usage ### Encrypting cipher = Gibberish::AES.new('p4ssw0rd') cipher.encrypt("some secret text") #=> "U2FsdGVkX1/D7z2azGmmQELbMNJV/n9T/9j2iBPy2AM=\n" ### Decrypting cipher = Gibberish::AES.new('p4ssw0rd') cipher.decrypt(""U2FsdGVkX1/D7z2azGmmQELbMNJV/n9T/9j2iBPy2AM=\n"") #=> "some secret text" ## OpenSSL Interop echo "U2FsdGVkX1/D7z2azGmmQELbMNJV/n9T/9j2iBPy2AM=\n" | openssl enc -d -aes-256-cbc -a -k p4ssw0rd ;F;!o;F;GF;Hi;Ii;"@;I"Gibberish::AES;F;>o;? ;@0;A0;B0;;C;"@;D0;)0;&To; ;IC;[o:&YARD::CodeObjects::ConstantObject;[[I"lib/gibberish/hmac.rb;Ti;F;: DIGEST;;;;;[;IC;" ;F;@;0;F;[;[; I";F;!0;"@;I"Gibberish::HMAC::DIGEST;F;Ui;$"DIGEST = {;#I"tDIGEST = { :sha1 => OpenSSL::Digest::Digest.new('sha1'), :sha256 => OpenSSL::Digest::Digest.new('sha256') };F: @valueI"k{ :sha1 => OpenSSL::Digest::Digest.new('sha1'), :sha256 => OpenSSL::Digest::Digest.new('sha256') };F;&To; ; ; ;;;I"Gibberish::HMAC.digest;F;[["key0[" data0[" opts"{};[[@i&;T;: digest;;;[;IC;"UReturns the HMAC for the key and data Shorcut alias: Gibberish::HMAC(key, data) ;F;@;0;F;[;[ o;+ ;,I" param;F;-0;I"key;F;.[I" String;F;@o;+ ;,I" param;F;-0;I" data;F;.[I" #to_s;F;@o;+ ;,I" param;F;-0;I" options;F;.[I" Hash;F;@o;K ;,I" option;F;-0;I" opts;F;.0;Lo;M ;,I" option;F;-I"the digest to encode with;F;I" :digest;F;.[I" Symbol;F;N[I" :sha1;F;@o;K ;,I" option;F;-0;I" opts;F;.0;Lo;M ;,I" option;F;-I"*encode the data in binary, not Base64;F;I" :binary;F;.[I" Boolean;F;N[I" false;F;@o;+ ;,I" param;F;-I""a customizable set of options;F;@ ;.[I" Hash;F;@; I"Returns the HMAC for the key and data Shorcut alias: Gibberish::HMAC(key, data) @param [String] key @param [#to_s] data @param [Hash] options @option opts [Symbol] :digest (:sha1) the digest to encode with @option opts [Boolean] :binary (false) encode the data in binary, not Base64;F;!o;F;GF;Hi;Ii%;"@;#I"def self.digest(key, data, opts={}) data = data.to_s digest_type = opts[:digest] || :sha1 if opts[:binary] OpenSSL::HMAC.digest(DIGEST[digest_type], key, data) else OpenSSL::HMAC.hexdigest(DIGEST[digest_type], key, data) end end;F;$I"def digest(.);F;%T;&T;)0;3@;4IC;[;3@;5IC;[;3@;6IC;7{; IC;7{;8T;'IC;7{;8T;8T;;{;<[;[[@i;T;: HMAC;;;;;[;IC;"Easy to use HMAC, defaults to SHA1 ## Example Gibberish::HMAC('key', 'data') #=> 104152c5bfdca07bc633eebd46199f0255c9f49d Gibberish::HMAC('key', 'data', :digest => :sha256) #=> 5031fe3d989c6d1537a013fa6e739da23463fdaec3b70137d828e36ace221bd0 ## OpenSSL CLI Interop echo -n "stuff" | openssl dgst -sha1 -hmac 'password' is the same as Gibberish::HMAC('password', 'stuff') ;F;@;0;F;[;[; I"Easy to use HMAC, defaults to SHA1 ## Example Gibberish::HMAC('key', 'data') #=> 104152c5bfdca07bc633eebd46199f0255c9f49d Gibberish::HMAC('key', 'data', :digest => :sha256) #=> 5031fe3d989c6d1537a013fa6e739da23463fdaec3b70137d828e36ace221bd0 ## OpenSSL CLI Interop echo -n "stuff" | openssl dgst -sha1 -hmac 'password' is the same as Gibberish::HMAC('password', 'stuff') ;F;!o;F;GF;Hi;Ii;"@;I"Gibberish::HMAC;F;>o;? ;@0;A0;B0;;C;"@;D0;)0;&To; ; ; ;;;I"Gibberish.HMAC;F;[["key0[" data0[" opts"{};[[@i1;F;;a;;;[;IC;" ;F;@:;0;F;[;[; I";F;!0;"@;#I"Tdef self.HMAC(key, data, opts={}) Gibberish::HMAC.digest(key, data, opts) end;F;$I"def HMAC(.);F;%T;&To; ;IC;[o; ; ; ;;;I"Gibberish::Digest.sha1;F;[[" data0[" opts"{};[[I"lib/gibberish/digest.rb;Ti%;T;: sha1;;;[;IC;"OReturns the SHA1 digest for the data Shorcut alias: Gibberish::SHA1(data) ;F;@O;0;F;[;[ o;+ ;,I" param;F;-0;I"key;F;.[I" String;F;@Oo;+ ;,I" param;F;-0;I" data;F;.[I" #to_s;F;@Oo;+ ;,I" param;F;-0;I" options;F;.[I" Hash;F;@Oo;K ;,I" option;F;-0;I" opts;F;.0;Lo;M ;,I" option;F;-I"*encode the data in binary, not Base64;F;I" :binary;F;.[I" Boolean;F;N[I" false;F;@Oo;+ ;,I" param;F;-I""a customizable set of options;F;@o;.[I" Hash;F;@O; I"Returns the SHA1 digest for the data Shorcut alias: Gibberish::SHA1(data) @param [String] key @param [#to_s] data @param [Hash] options @option opts [Boolean] :binary (false) encode the data in binary, not Base64;F;!o;F;GF;Hi;Ii$;"@M;#I"def self.sha1(data, opts={}) data = data.to_s if opts[:binary] OpenSSL::Digest::SHA1.digest(data) else OpenSSL::Digest::SHA1.hexdigest(data) end end;F;$I"def sha1(.);F;%T;&T;)0o; ; ; ;;;I"Gibberish::Digest.sha256;F;[[" data0[" opts"{};[[@Yi6;T;: sha256;;;[;IC;"SReturns the SHA256 digest for the data Shorcut alias: Gibberish::SHA256(data) ;F;@;0;F;[;[ o;+ ;,I" param;F;-0;I"key;F;.[I" String;F;@o;+ ;,I" param;F;-0;I" data;F;.[I" #to_s;F;@o;+ ;,I" param;F;-0;I" options;F;.[I" Hash;F;@o;K ;,I" option;F;-0;I" opts;F;.0;Lo;M ;,I" option;F;-I"*encode the data in binary, not Base64;F;I" :binary;F;.[I" Boolean;F;N[I" false;F;@o;+ ;,I" param;F;-I""a customizable set of options;F;@;.[I" Hash;F;@; I"Returns the SHA256 digest for the data Shorcut alias: Gibberish::SHA256(data) @param [String] key @param [#to_s] data @param [Hash] options @option opts [Boolean] :binary (false) encode the data in binary, not Base64;F;!o;F;GF;Hi.;Ii5;"@M;#I"def self.sha256(data, opts={}) data = data.to_s if opts[:binary] OpenSSL::Digest::SHA256.digest(data) else OpenSSL::Digest::SHA256.hexdigest(data) end end;F;$I"def sha256(.);F;%T;&T;)0o; ; ; ;;;I"Gibberish::Digest.md5;F;[[" data0[" opts"{};[[@YiG;T;:md5;;;[;IC;"MReturns the MD5 digest for the data Shorcut alias: Gibberish::MD5(data) ;F;@;0;F;[;[ o;+ ;,I" param;F;-0;I"key;F;.[I" String;F;@o;+ ;,I" param;F;-0;I" data;F;.[I" #to_s;F;@o;+ ;,I" param;F;-0;I" options;F;.[I" Hash;F;@o;K ;,I" option;F;-0;I" opts;F;.0;Lo;M ;,I" option;F;-I"*encode the data in binary, not Base64;F;I" :binary;F;.[I" Boolean;F;N[I" false;F;@o;+ ;,I" param;F;-I""a customizable set of options;F;@;.[I" Hash;F;@; I"Returns the MD5 digest for the data Shorcut alias: Gibberish::MD5(data) @param [String] key @param [#to_s] data @param [Hash] options @option opts [Boolean] :binary (false) encode the data in binary, not Base64;F;!o;F;GF;Hi?;IiF;"@M;#I"def self.md5(data, opts={}) data = data.to_s if opts[:binary] OpenSSL::Digest::MD5.digest(data) else OpenSSL::Digest::MD5.hexdigest(data) end end;F;$I"def md5(.);F;%T;&T;)0;3@M;4IC;[;3@M;5IC;[;3@M;6IC;7{; IC;7{;8T;'IC;7{;8T;8T;;{;<[;[[@Yi;T;: Digest;;;;;[;IC;"6Allows for the simple digest of data, supports MD5, SHA1, and SHA256 ## Examples Gibberish::MD5("data") #=> 8d777f385d3dfec8815d20f7496026dc Gibberish::SHA1("data") #=> a17c9aaa61e80a1bf71d0d850af4e5baa9800bbd Gibberish::SHA256("data") #=> 3a6eb0790f39ac87c94f3856b2dd2c5d110e6811602261a9a923d3bb23adc8b7 ## OpenSSL CLI Interop echo -n 'data' | openssl dgst -sha1 echo -n 'data' | openssl dgst -sha256 echo -n 'data' | openssl dgst -md5 is the same as Gibberish::SHA1("data") Gibberish::SHA256("data") Gibberish::MD5("data") ;F;@M;0;F;[;[; I"7Allows for the simple digest of data, supports MD5, SHA1, and SHA256 ## Examples Gibberish::MD5("data") #=> 8d777f385d3dfec8815d20f7496026dc Gibberish::SHA1("data") #=> a17c9aaa61e80a1bf71d0d850af4e5baa9800bbd Gibberish::SHA256("data") #=> 3a6eb0790f39ac87c94f3856b2dd2c5d110e6811602261a9a923d3bb23adc8b7 ## OpenSSL CLI Interop echo -n 'data' | openssl dgst -sha1 echo -n 'data' | openssl dgst -sha256 echo -n 'data' | openssl dgst -md5 is the same as Gibberish::SHA1("data") Gibberish::SHA256("data") Gibberish::MD5("data") ;F;!o;F;GF;Hi;Ii;"@;I"Gibberish::Digest;F;>o;? ;@0;A0;B0;;C;"@;D0;)0;&To; ; ; ;;;I"Gibberish.SHA1;F;[[" data0[" opts"{};[[@YiQ;F;: SHA1;;;[;IC;" ;F;@;0;F;[;[; I";F;!0;"@;#I">def self.SHA1(data, opts={}) Digest.sha1(data,opts) end;F;$I"def SHA1(.);F;%T;&To; ; ; ;;;I"Gibberish.SHA256;F;[[" data0[" opts"{};[[@YiU;F;: SHA256;;;[;IC;" ;F;@;0;F;[;[; I";F;!0;"@;#I"Bdef self.SHA256(data, opts={}) Digest.sha256(data,opts) end;F;$I"def SHA256(.);F;%T;&To; ; ; ;;;I"Gibberish.MD5;F;[[" data0[" opts"{};[[@YiY;F;:MD5;;;[;IC;" ;F;@;0;F;[;[; I";F;!0;"@;#I"