Skip to content

sam0x17/aes.cr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aes.cr

Wrapper for openssl's AES encryption and decryption functionality.

Installation

OpenSSL development packages are required for this shard to build. On apt-based systems this can be installed via sudo apt install libssl-dev.

Add this to your application's shard.yml:

dependencies:
  aes:
    github: sam0x17/aes.cr

Usage

require "aes"

aes = AES.new
puts aes.decrypt(aes.encrypt("hello world")) # => "hello world"
data = Bytes[0, 33, 128, 145, 77, 43, 32, 189, 250, 123]
puts aes.encrypt(data) # => encrypted bytes
puts aes.iv
puts aes.key

See src/aes.cr for full API info. Streaming is supported.

About

crystal wrapper for OpenSSL AES CBC mode encryption routines

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •