Ruby生成GoEasy-OTP - GoEasy

Ruby生成GoEasy-OTP

  def self.generate_otp
    Base64.encode64(Aes.encrypt($config.goeasy.secret_key, "000#{Time.now.to_f.to_s.gsub(".", "").to(12)}")).strip
  end

验证OTP生成结果

测试参数:

secret key:86726e4356dce2d3

系统毫秒数:1490325990593

测试结果:

GoEasy-otp:+rOKqbTZioistsdMrhon0A==

results matching ""

    No results matching ""