Rubyã§æå·åãããã¼ã¿ãJavaã§å¾©å·åãã¾ããã®éãè¡ã£ã¦ã¿ãã ä»åã¯AES128ãããã®æå·åã¢ã¼ãCBCãããã£ã³ã°ã¯PKCS#5ã§å®æ½ã ã¾ãRubyå´ã®ã³ã¼ãã require 'openssl' require 'base64' class CryptUtil def self.encrypt(pass, value) enc = OpenSSL::Cipher.new('aes-128-cbc') # æå·åor復å·åã©ã¡ããè¡ããã»ããï¼ä»åã¯æå·åï¼ã復å·åã®å ´åã¯decrypt enc.encrypt # ivãçæ iv = OpenSSL::Random.random_bytes(16) # æå·åããéã®ãã¼æååãã»ãã enc.key = pass # ivãã»ãã enc.iv = iv crypted = "" crypted << enc.upda
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}