Ruby Aes ECB模式 秘钥长度256 无填充模式的加解密方法
#!/usr/bin/ruby
require 'openssl'
class AesEcb256
def encrypt(key, data, padding)
aes = OpenSSL::Cipher.new("AES-256-ECB")
aes.encrypt
aes.key = key
aes.padding = padding
length = 1...