stymiee/php-simple-encryption

View on GitHub
src/Encryption/Traits/encryptWithoutPadding.php.txt

Summary

Maintainability
Test Coverage
<?php

declare(strict_types=1);

namespace Encryption\Traits;

trait EncryptWithoutPadding
{
    public function encrypt(string $plainText, string $key, string $iv): string
    {
        return base64_encode(openssl_encrypt($plainText, static::CIPHER, $key, OPENSSL_RAW_DATA, $iv));
    }
}