OpenSSL::Cipher::Cipher#padding= ã§ããã£ã³ã°å¦çã®æç¡ãå¶å¾¡ã§ãããã§ã¯å®éã«ã©ã®ãããªããã£ã³ã°å¦çãè¡ããã¦ããã®ã ããï¼ æå·åæã«ã¯ããã£ã³ã°ãæå¹ã«ãã¦ã復å·æã«ç¡å¹ã«ããã°ç¢ºèªã§ããã # Ruby 1.8.7 or 1.9 require 'openssl' def enc_dec_base(operation) password = 'fixed password' lambda do | cipher, data, padding | c = OpenSSL::Cipher::Cipher.new(cipher) c.send(operation) c.padding = padding c.pkcs5_keyivgen(password) c.update(data) + c.final end end encrypt = enc_de
{{#tags}}- {{label}}
{{/tags}}