-
-
Save qmx/cb0450e5b2cb714a0ce8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pure-ruby-aes (as openssl isn't ready on ir, afaik) | |
# ir -Sgem install ruby-aes-normal | |
require 'ruby-aes' | |
require 'yaml' | |
KEY="0"*32 | |
IV="0"*32 | |
# mine is several times bigger than this (20x) | |
# works flawlessly on small strings | |
original_data = {:some => [{:random => "hash"},{:random => "hash"}]}.to_yaml | |
crypto_data = Aes.encrypt_buffer(256, 'CBC', KEY, IV, original_data) | |
# it will break here, as ruby-aes will try to size the buffer for breaking it on chunks | |
clear_data = Aes.decrypt_buffer(256, 'CBC', KEY, IV, crypto_data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment