实现代码: 代码如下:class Des require ‘openssl’ require ‘base64’ ALG = ‘DES-EDE3-CBC’ KEY = “mZ4Wjs6L” DES_KEY = “nZ4wJs6L” #加密 def encode(str) des = OpenSSL::Cipher::Cipher.new(ALG) des.pkcs5_keyivgen(KEY, DES_KEY) des.encrypt cipher = des.update(str) cipher &l