SkillAgentSearch skills...

AES

Encrypt and Decrypt data with AES algorithm

Install / Use

/learn @shetabit/AES
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

AES

Maintainability Scrutinizer Code Quality StyleCI

Encrypt and Decrypt data with AES algorithm with PHP

Feature

  • Set manually iv suitable for static inialization vector (IV)
  • Set randomly iv (Recomended)

Example (Static IV)

require "AES.php";

$aes = new AES(
	'WR7rLKlVvJdEAIzHUMpt4dcEKsXPinIU2KiWzm++bhg=',
	'AES-256-CBC',
	'NJ0oI9P1fytagUfPny3qTA=='
);

$plainText = "Please, encrypt me!";

$encrypted = $aes->encrypt($plainText);

echo "Encrypted : {$encrypted}<br />";

$decrypted = $aes->decrypt($encrypted);

echo "Decrypted : {$decrypted}<br />";

Example (Dynamic IV)

require "AES.php";

$aes = new AES(
	'WR7rLKlVvJdEAIzHUMpt4dcEKsXPinIU2KiWzm++bhg=',
	'AES-256-CBC'
);

$plainText = "Please, encrypt me!";

$encrypted = $aes->encrypt($plainText);

echo "Encrypted : {$encrypted}<br />";

$decrypted = $aes->decrypt($encrypted, true);

echo "Decrypted : {$decrypted}<br />";
View on GitHub
GitHub Stars8
CategoryDevelopment
Updated5y ago
Forks0

Languages

PHP

Security Score

60/100

Audited on Aug 24, 2020

No findings