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

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).

Build Status Scrutinizer Quality Score Dependency Status Latest Stable Version Total Downloads Latest Unstable Version License

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.