📄 20c02-1.php
字号:
<?php// Assume that we have been given the following password:$password = 'bob123xy';// Now encrypt this password, we will not provide the optional second// parameter to specify a 'salt' or 'seed' for the encryption, since the// specifics can vary per system, easiest to leave it blank.$enc = crypt($password);// Now, let's assume that we've just been given a password as part of a login// Let's try to recrypt it to match. This time pass the encrypted version as// the 'salt' so that it can generate it again. The original salt is saved // as part of the encryption process. -- This should echo GOOD.if (crypt($password, $enc) == $enc) { echo 'GOOD';} else { echo 'FAILED';}?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -