Ruby on Rails Decryption

前端 未结 2 1562
南笙
南笙 2021-01-26 04:36

The following function works perfect in PHP. How can it be translated in Ruby on Rails.

Please note that both privateKey and iv are 32 characters long.

m         


        
2条回答
  •  [愿得一人]
    2021-01-26 05:09

    You are base64 decoding it in the php example. Are you doing that in the ruby one as well?

    require "base64"
    Base64.decode64(encrypted)
    

    Other than that, the code looks right to me.

提交回复
热议问题