phpaes's People
Forkers
aaatschecksche amamatthew ariborneo ltc-macrochen ansendu taganden godhelpjun evencom 1506430045 xianjie2017 sansob herenchang editea technicalshadow denobisipsis 578939494 ayman-nageeb winner7776 hybridhyper jasonyu alexisgs09 yanlinhust cr0bar pleileilei jerryuam aileshe letuananh1873 nguyenanhung amculin jeisc ko6phpaes's Issues
Composer is BS i dont get it! dont use it remake this!
Dont like composer BS re make this to work out of the box!
way old AES.class.php
I have your way old class from Oct 1, 2007. This older class doesn't seem to be compatible with other libraries to decrypt AES128 not was i able to just drop in this newer class to replace it. I'm thinking i need to decrypt with the older class and then re-encrypt with the newer one to get some compatibility?
AES and PHP 7.3.3
I've been using AES on PHP 5.x for some time, but now my servers are being updated to PHP 7.3.3.
I tested my existing setup on 7.3.3, and using CBC mode (which is required) validation was failing.
No error messages are shown.
I set up a test on 7.3.3 which prints out the encrypted and decrypted outputs and the decrypted output still looks encrypted
The only clue I've found relates to changes in "__construct", but I don't know enough to decide if that may be the problem.
A demo is at:
http://fyefield.com/php_aes/aes_demo.php
GeeDeeJay
Use exception instead of die
Hi,
could you please use an exception instead of die function in case the configuration contains errors?
Kind regards
Michael
Some code in keyExpansion missing
for (; $i < self::$Nb*($this->Nr+1); $i++) {
^
$i for initial is missing or deleted ??
Does this *really* support PHP4, like your website homepage claims ?
If not - can you please include the PHP4 version ?
from phpaes.com:-
" phpAES is a PHP 5 (PHP 4 version now included) class implementation of 128, 192, and 256 bit AES encryption cipher. I "
Changed behaviour of old version across PHP versions
I ran into something like #4 / #8 recently when I moved an older app to new hosting; figured I'd document my process in tracking the issue down here. I was using a version of AES.class.php dated October 1, 2007, and the old hosting was PHP5.4. (Don't laugh!)
<?php
include 'Aes2007.php';
include 'Aes2018.php';
use AES as Aes2007;
use PhpAes\Aes as Aes2018;
$key = 'abcdefgh01234567';
$secret = 'Hello, world!';
$aes2007 = new Aes2007($key);
$enc2007 = $aes2007->encrypt($secret);
$aes2018 = new Aes2018($key);
$enc2018 = $aes2018->encrypt($secret);
echo 'MD5 2007: ' . md5($enc2007) . PHP_EOL;
echo 'MD5 2018: ' . md5($enc2018) . PHP_EOL;
$ for VERSION in 5.4 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 ; do echo Testing with PHP $VERSION ; docker run --rm -v `pwd`:/app php:$VERSION php /app/aes-test.php ; echo ; done
Testing with PHP 5.4
MD5 2007: f0ad7ccf34653a5229ae9ab4c9fdf8b0
MD5 2018: f0ad7ccf34653a5229ae9ab4c9fdf8b0
Testing with PHP 5.5
MD5 2007: f0ad7ccf34653a5229ae9ab4c9fdf8b0
MD5 2018: f0ad7ccf34653a5229ae9ab4c9fdf8b0
Testing with PHP 5.6
MD5 2007: f0ad7ccf34653a5229ae9ab4c9fdf8b0
MD5 2018: f0ad7ccf34653a5229ae9ab4c9fdf8b0
Testing with PHP 7.0
MD5 2007: f0ad7ccf34653a5229ae9ab4c9fdf8b0
MD5 2018: f0ad7ccf34653a5229ae9ab4c9fdf8b0
Testing with PHP 7.1
MD5 2007: b3bb9a36713bdc2dde76139d23eb0d03
MD5 2018: f0ad7ccf34653a5229ae9ab4c9fdf8b0
Testing with PHP 7.2
MD5 2007: b3bb9a36713bdc2dde76139d23eb0d03
MD5 2018: f0ad7ccf34653a5229ae9ab4c9fdf8b0
Testing with PHP 7.3
MD5 2007: b3bb9a36713bdc2dde76139d23eb0d03
MD5 2018: f0ad7ccf34653a5229ae9ab4c9fdf8b0
Testing with PHP 7.4
MD5 2007: b3bb9a36713bdc2dde76139d23eb0d03
MD5 2018: f0ad7ccf34653a5229ae9ab4c9fdf8b0
Testing with PHP 8.0
Warning: Only the first byte will be assigned to the string offset in /app/Aes2007.php on line 1421 (repeated a lot of times)
MD5 2007: b3bb9a36713bdc2dde76139d23eb0d03
MD5 2018: f0ad7ccf34653a5229ae9ab4c9fdf8b0
For completeness, I'll document the original AES.class.php in the next comment.
My takeaway was that the class behaviour should be consistent if I swap to using the updated class in the new environment, but that the original class (older than the initial commit in this repo) changes behaviour between PHP7.0 and PHP7.1.
Use 128 bit or 256
Hi
Can i define bit size (128,256) before encrypt or decrypt?
Is the current 128 bit?
Thanks
Given final block not properly padded.
I have used your example code to test, but when I use https://www.devglan.com/online-tools/aes-encryption-decryption to decode the test I receive the following error:
Given final block not properly padded. Such issues can arise if a bad key is used during decryption.
Is there something I am missing?
namespace PhpAes couldn't be read
I call namespace and class like this use PhpAes/Aes, but the namespace PhpAes couldn't be read
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.