Lines Matching defs:key

26     protected const KCC_MC = 'Digest H(A1) to client-to-server sealing key magic constant';
28 protected const KCS_MC = 'Digest H(A1) to server-to-client sealing key magic constant';
30 protected const KIC_MC = 'Digest session key to client-to-server signing key magic constant';
32 protected const KIS_MC = 'Digest session key to server-to-client signing key magic constant';
145 [$iv, $key] = $this->generateKeyAndIV($cipher, $kc);
146 $data = openssl_decrypt($encrypted, self::CIPHERS[$cipher]['cipher'], $key, OPENSSL_NO_PADDING | OPENSSL_RAW_DATA, $iv);
192 [$iv, $key] = $this->generateKeyAndIV($cipher, $kc);
193 $encrypted = openssl_encrypt($data . $padding . $macBlock, self::CIPHERS[$cipher]['cipher'], $key, OPENSSL_NO_PADDING | OPENSSL_RAW_DATA, $iv);
299 protected function generateMACBlock(string $key, string $message, int $seqNum): string
303 $macBlock = substr(hash_hmac('md5', $seqNum . $message, $key, true), 0, 10);
314 * Kic = MD5({H(A1), "Digest session key to client-to-server signing key magic constant"})
315 * Kis = MD5({H(A1), "Digest session key to server-to-client signing key magic constant"})
324 * The key for encrypting messages from client to server / server to client:
326 * Kcc = MD5({H(A1)[0..n], "Digest H(A1) to client-to-server sealing key magic constant"})
327 * Kcs = MD5({H(A1)[0..n], "Digest H(A1) to server-to-client sealing key magic constant"})
329 * Where the key size is determined by "n" above.
342 # No IV and all of the kc for the key with RC4 types
349 $key = $this->expandDesKey(substr($kc, 0, 7));
354 $key = '';
356 $key .= $this->expandDesKey($desKey);
360 return [$iv, $key];
367 protected function expandDesKey(string $key): string
372 $bytes[$i] = ord($key[$i]);