MCRYPT_MODE_ECB,$ iv); 然后我试图通过加密输入的密码 然后比较它来登录保存的密码。然而,尽管每次通话都是 ,输入是相同的, MCRYPT_XTEA =" xtea"; ENCRYPTION_KEY =" sdlk2kcow8doq92k"; $ p_str =" demo"; MCRYPT_MODE_ECB =" ecb"; $ iv = jX%uk?* =" ;; 在一次通话中我得到加密的字符串,?;jé?? G·而在另一个 电话,我得到?34Avy?。什么给了? 谢谢, - Dave Hi, I''m using PHP 4.4.4. An odd thing is happening with themcrypt_encrypt function. I am trying to encrypt a string of data (forpassword storage): $enc = mcrypt_encrypt(MCRYPT_XTEA, ENCRYPTION_KEY, $p_str,MCRYPT_MODE_ECB, $iv); and then I''m trying to log in later by encrypting the entered passwordand comparing it to the saved password. However, despite the factthat for each call, the inputs are the same, MCRYPT_XTEA = "xtea";ENCRYPTION_KEY = "sdlk2kcow8doq92k";$p_str = "demo";MCRYPT_MODE_ECB = "ecb";$iv = "jX%uk?*="; on one call I get the encrypted string, "?;jé??G·" and on the othercall, I get "?34Avy?". What gives? Thanks, - Dave 推荐答案 enc = mcrypt_encrypt(MCRYPT_XTEA, ENCRYPTION_KEY,enc = mcrypt_encrypt(MCRYPT_XTEA, ENCRYPTION_KEY, p_str, MCRYPT_MODE_ECB,p_str,MCRYPT_MODE_ECB, iv); 然后我试着通过加密输入的密码 并将其与保存的密码进行比较来登录。然而,尽管每次通话都是 ,输入是相同的, MCRYPT_XTEA =" xtea"; ENCRYPTION_KEY =" sdlk2kcow8doq92k" ;; iv); and then I''m trying to log in later by encrypting the entered passwordand comparing it to the saved password. However, despite the factthat for each call, the inputs are the same, MCRYPT_XTEA = "xtea";ENCRYPTION_KEY = "sdlk2kcow8doq92k"; 这篇关于mcrypt_encrypt为同一输入提供不同的结果?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-21 02:15