PHP 클래스 ParagonIE\PasswordLock\PasswordLock

파일 보기 프로젝트 열기: paragonie/password_lock 1 사용 예제들

공개 메소드들

메소드 설명
decryptAndVerify ( string $password, string $ciphertext, Defuse\Crypto\Key $aesKey ) : boolean 1. VerifyHMAC-then-Decrypt the ciphertext to get the hash 2. Verify that the password matches the hash
decryptAndVerifyLegacy ( string $password, string $ciphertext, string $aesKey ) : boolean 1. VerifyHMAC-then-Decrypt the ciphertext to get the hash 2. Verify that the password matches the hash
hashAndEncrypt ( string $password, Defuse\Crypto\Key $aesKey ) : string 1. Hash password using bcrypt-base64-SHA256 2. Encrypt-then-MAC the hash
rotateKey ( string $ciphertext, Defuse\Crypto\Key $oldKey, Defuse\Crypto\Key $newKey ) : string Key rotation method -- decrypt with your old key then re-encrypt with your new key
upgradeFromVersion1 ( string $password, string $ciphertext, string $oldKey, Defuse\Crypto\Key $newKey ) : string For migrating from an older version of the library

메소드 상세

decryptAndVerify() 공개 정적인 메소드

1. VerifyHMAC-then-Decrypt the ciphertext to get the hash 2. Verify that the password matches the hash
public static decryptAndVerify ( string $password, string $ciphertext, Defuse\Crypto\Key $aesKey ) : boolean
$password string
$ciphertext string
$aesKey Defuse\Crypto\Key
리턴 boolean

decryptAndVerifyLegacy() 공개 정적인 메소드

1. VerifyHMAC-then-Decrypt the ciphertext to get the hash 2. Verify that the password matches the hash
public static decryptAndVerifyLegacy ( string $password, string $ciphertext, string $aesKey ) : boolean
$password string
$ciphertext string
$aesKey string - must be exactly 16 bytes
리턴 boolean

hashAndEncrypt() 공개 정적인 메소드

1. Hash password using bcrypt-base64-SHA256 2. Encrypt-then-MAC the hash
public static hashAndEncrypt ( string $password, Defuse\Crypto\Key $aesKey ) : string
$password string
$aesKey Defuse\Crypto\Key
리턴 string

rotateKey() 공개 정적인 메소드

Key rotation method -- decrypt with your old key then re-encrypt with your new key
public static rotateKey ( string $ciphertext, Defuse\Crypto\Key $oldKey, Defuse\Crypto\Key $newKey ) : string
$ciphertext string
$oldKey Defuse\Crypto\Key
$newKey Defuse\Crypto\Key
리턴 string

upgradeFromVersion1() 공개 정적인 메소드

For migrating from an older version of the library
public static upgradeFromVersion1 ( string $password, string $ciphertext, string $oldKey, Defuse\Crypto\Key $newKey ) : string
$password string
$ciphertext string
$oldKey string
$newKey Defuse\Crypto\Key
리턴 string