shrikeh / crypto
OOP implementations of various encryption methods for PHP. Standardises implementation across different methods (mcrypt, openssl, etc).
dev-master
2016-05-10 14:25 UTC
Requires
- php: >=5.3.3
- ircmaxell/password-compat: dev-master
Requires (Dev)
- phpspec/phpspec: ^2.5
This package is auto-updated.
Last update: 2024-12-06 03:45:58 UTC
README
OOP implementations of various encryption methods for PHP. Standardises implementation across different methods (mcrypt, openssl, etc).
Why bother?
There's a few advantages to handling encryption and password hashing via objects.
- if you use PHPUnit or Mockery, you'll find it a lot easier to mock pass/fail results.
- all of these have tests, so you don't have to write any for basic encryption, simplifying development.
- it helps dependency injection-led development by abstracting away the details of encryption implementation
- swapping out one form of encryption for another should be fairly easy (so long as you also update your data)
The Dos and Don'ts of Passwords
- don't use the username of a user as these aren't globally unique and allow for rainbow table attacks.