skavinvarnan / Cross-Platform-AES

Simple cross-platform encryption and decryption using AES
MIT License
142 stars 69 forks source link

Added PHP support. #13

Closed ahsankhatri closed 5 years ago

skavinvarnan commented 5 years ago

@ahsankhatri thanks for the PR. Can you confirm the output for the below two examples.

Example 1

Cipher Text: "GfTE0IK4zk039+042LwPvsTjr0A8LqBDcxDWAc41YmwxNjZVJ3CcuDxWXsulbUjE"
Cipher Text: "53zydKWD3CJCoSm9YBYaV+pwwGtSP/f36nIfUnRV3GwTFsQXgX84nh0Tu6JpsHkf"
Cipher Text: "h0PMUJhigwVnJZD43i9q98b/AG7GUg8T2BdsQ4Yun2dQHPqSE5QF0RSiHUW0wguc"
Cipher Text: "EhYJzR5oaziXCSJ2ha63Oun6HXLkCILWuJWVUAl64JpU3OdvKNyoA3rKuOj+qfEO"

key: "your key"

Example 2

Cipher Text: "71g9R98ALCvYD0AVCtNJhEik/00jvon+ductEBlt601Er6tqFrtH0kIB+62O2DPiEsKcSilUez2MXsyGzA2Z9KM8h/tiLmM6psaSLaFELXw="
Cipher Text: "f9ofx42+h5SzJI5sXa+NExyCpxXRdhLcYcuvAsX6qCkxEw10GMzYCnSslV5Ku3v5w96QlHVceLn6yBcUBeZHlpbcnKv38ZKCGxTTv95gIN0="
Cipher Text: "CvG+gJuY5mrcjQa5OfGSA39tQtgEK1fj/OMR8Jaw2XmBOGLWJvII6nNfSvhhGLYG31X65wSLTy6Naz/OTrkEA7KOlpM5PYPpjbY06JA7zHg="
Cipher Text: "C7Bc+bSC1cri0DJ6nLoGoslfMPb4nVea0xHla8nQaOilPTpAx5N8ziLZC7UhpdiSnzYqRmh0WiH5u0wJmAn0JEEFqsxhW6z0biFmT6p8x1s="

key: "%^^&&@(*&@##)@)@``~~"

Also i could see that in the Example.php file that php tag was not closed properly. Can you please fix that.

ahsankhatri commented 5 years ago

Yes, while porting to PHP I've verified by trying both example before and FYI closing tags are discouraged in PHP to avoid any unnecessary whitespace at the end of the file if it has wholly PHP code.

skavinvarnan commented 5 years ago

Thanks for the PR. Will merge it now.