Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/logging/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 如何在attr_encrypted中使用相同的iv和salt加密2个属性?_Ruby On Rails_Attr Encrypted - Fatal编程技术网

Ruby on rails 如何在attr_encrypted中使用相同的iv和salt加密2个属性?

Ruby on rails 如何在attr_encrypted中使用相同的iv和salt加密2个属性?,ruby-on-rails,attr-encrypted,Ruby On Rails,Attr Encrypted,我有两个属性,分别是user\u name和password。我想使用attr\u encrypted和peru属性_iv_和_salt模式进行加密,我将iv和salt存储在数据库中。我不想对每个属性使用单独的iv和salt。是否有一种模式只有一个Iv和Salt来加密两者

我有两个属性,分别是
user\u name
password
。我想使用
attr\u encrypted
peru属性_iv_和_salt
模式进行加密,我将
iv
salt
存储在数据库中。我不想对每个属性使用单独的
iv
salt
。是否有一种模式只有一个
Iv
Salt
来加密两者