Class | EzCrypto::Key |
In: |
lib/ezcrypto.rb
|
Parent: | Object |
The Key is the only class you need to understand for simple use.
The crypto algorithms default to aes-128-cbc however on any of the class methods you can change it to one of the standard openssl cipher names using the optional :algorithm=>alg name parameter.
Eg.
Key.new @raw, :algorithm=>"des" Key.generate :algorithm=>"blowfish" Key.with_password @pwd,@salt,:algorithm=>"aes256"
ActiveCrypto and EzCrypto are released under the MIT license.
To contact the author, send mail to pelleb@gmail.com
Also see my blogs at: stakeventures.com and neubia.com
This project was based on code used in my project StakeItOut, where you can securely share web services with your partners. stakeitout.com
(C) 2005 Pelle Braendgaard
algorithm | [R] | |
raw | [R] |
Given an algorithm this calculates the keysize. This is used by both the generate and with_password methods. This is not yet 100% complete.
Decrypts the data with the given password and a salt. Short hand for:
key=Key.with_password(password,salt,options) key.decrypt(data)
Encrypts the data with the given password and a salt. Short hand for:
key=Key.with_password(password,salt,options) key.encrypt(data)
Initialize the key with raw unencoded binary key data. This needs to be at least 16 bytes long for the default aes-128 algorithm.
Decrypt a file ‘inplace’ and remove a suffix see cipher_file IMPORTANT: The inputfile will be deleted by default.
Encrypt a file ‘inplace’ and add a suffix see cipher_file. IMPORTANT: The inputfile will be deleted by default.
Create a Decrypter object and yield it to a block. You must not call final by yourself, the method does this.
Create an Encrypter object and yield it to a block. You must not call final by yourself, the method does this.