<commit_before><?php

/**
 * Aes.php
 * 
 * PHP version 5
 * 
 * @category Dcrypt
 * @package  Dcrypt
 * @author   <NAME> (mmeyer2k) <<EMAIL>>
 * @license  http://opensource.org/licenses/MIT The MIT License (MIT)
 * @link     https://github.com/mmeyer2k/dcrypt
 */

namespace Dcrypt;

use Symfony\Component\Security\Core\Util\StringUtils;

/**
 * Symmetric AES encryption implementation wrapper functions.
 * 
 * Features:
 *     - PKCS #7 padding of messages
 *     - random IV selection
 *     - checksum validation with SHA-256 HMAC
 *     - tested to be compatible with many ciphers, modes and hashing algorithms.
 *     - highly customizable, but default options are most secure
 *
 * @category Dcrypt
 * @package  Dcrypt
 * @author   <NAME> (mmeyer2k) <<EMAIL>>
 * @license  http://opensource.org/licenses/MIT The MIT License (MIT)
 * @link     https://github.com/mmeyer2k/dcrypt
 */
class Aes
{

    /**
     * Create a message authentication checksum.
     * 
     * @param string $cyphertext Cyphertext that needs a check sum.
     * @param string $iv         Initialization vector.
     * @param string $key        Encryption key that will act as an HMAC 
     *                           verification signature.
     * @param string $mode       Mcrypt mode
     * @param string $cipher     Mcrypt cipher
     * @param string $algo       Hashing algorithm to use for internal operations
     * 
     * @return string
     */
    private static function _checksum($cyphertext, $iv, $key, $mode, $cipher, $algo)
    {<commit_msg>Update Aes.php<commit_after><?php

/**
 * Aes.php
 * 
 * PHP version 5
 * 
 * @category Dcrypt
 * @package  Dcrypt
 * @author   <NAME> (mmeyer2k) <<EMAIL>>
 * @license  http://opensource.org/licenses/MIT The MIT License (MIT)
 * @link     https://github.com/mmeyer2k/dcrypt
 */

namespace Dcrypt;

use Symfony\Component\Security\Core\Util\StringUtils;

/**
 * Symmetric AES encryption implementation wrapper functions.
 * 
 * Features:
 *     - PKCS #7 padding of messages
 *     - random IV selection
 *     - checksum validation with SHA-256 HMAC by default
 *     - tested to be compatible with many ciphers, modes and hashing algorithms.
 *     - highly customizable, but default options are most secure
 *
 * @category Dcrypt
 * @package  Dcrypt
 * @author   <NAME> (mmeyer2k) <<EMAIL>>
 * @license  http://opensource.org/licenses/MIT The MIT License (MIT)
 * @link     https://github.com/mmeyer2k/dcrypt
 */
class Aes
{

    /**
     * Create a message authentication checksum.
     * 
     * @param string $cyphertext Cyphertext that needs a check sum.
     * @param string $iv         Initialization vector.
     * @param string $key        Encryption key that will act as an HMAC 
     *                           verification signature.
     * @param string $mode       Mcrypt mode
     * @param string $cipher     Mcrypt cipher
     * @param string $algo       Hashing algorithm to use for internal operations
     * 
     * @return string
     */
    private static function _checksum($cyphertext, $iv, $key, $mode, $cipher, $algo)
    {
{'fraction_non_alphanumeric': 0.10401814646791964, 'fraction_numerical': 0.005832793259883344, 'mean_word_length': 2.5199543899657924, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 15, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1587574', 'n_tokens_mistral': 953, 'n_tokens_neox': 912, 'n_words': 293}