Lines Matching defs:cipher

46             'cipher' => 'des-ede3-cbc',
51 'cipher' => 'des-ede-cbc'
56 'cipher' => 'rc4',
61 'cipher' => 'rc4-40',
66 'cipher' => 'rc4-56',
136 $cipher = $context->get('cipher');
139 $this->validateCipher($cipher);
144 $kc = $this->generateKeyKc($a1, $cipher, $mcKc);
145 [$iv, $key] = $this->generateKeyAndIV($cipher, $kc);
146 $data = openssl_decrypt($encrypted, self::CIPHERS[$cipher]['cipher'], $key, OPENSSL_NO_PADDING | OPENSSL_RAW_DATA, $iv);
151 if (self::CIPHERS[$cipher]['block_size'] > 1) {
152 $message = $this->removePadding($message, self::CIPHERS[$cipher]['block_size']);
174 $cipher = $context->get('cipher');
178 $this->validateCipher($cipher);
181 $kc = $this->generateKeyKc($a1, $cipher, $mcKc);
191 $padding = $this->generatePadding($data, self::CIPHERS[$cipher]['block_size']);
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);
224 protected function validateCipher(string $cipher): void
226 if (!isset(self::CIPHERS[$cipher])) {
228 'The cipher "%s" is not supported.',
229 $cipher
276 * If the blocksize of the chosen cipher is not 1 byte, the padding prefix is one or more octets each containing the
331 protected function generateKeyKc(string $a1, string $cipher, string $mc): string
335 substr($a1, 0, self::CIPHERS[$cipher]['kcn']) . $mc,
340 protected function generateKeyAndIV(string $cipher, string $kc): array
343 if ($cipher === 'rc4' || $cipher === 'rc4-40' || $cipher === 'rc4-56') {
348 if ($cipher === 'des') {