Strength.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. /**
  3. * The strength FlyweightEnum class
  4. *
  5. * PHP version 5.3
  6. *
  7. * @category PHPPasswordLib
  8. * @package Core
  9. * @author Anthony Ferrara <ircmaxell@ircmaxell.com>
  10. * @copyright 2011 The Authors
  11. * @license http://www.opensource.org/licenses/mit-license.html MIT License
  12. * @version Build @@version@@
  13. */
  14. namespace SecurityLib;
  15. /**
  16. * The strength FlyweightEnum class
  17. *
  18. * All mixing strategies must extend this class
  19. *
  20. * @category PHPPasswordLib
  21. * @package Core
  22. * @author Anthony Ferrara <ircmaxell@ircmaxell.com>
  23. */
  24. class Strength extends Enum {
  25. /**
  26. * We provide a default value of VeryLow so that we don't accidentally over
  27. * state the strength if we forget to pass in a value...
  28. */
  29. const __DEFAULT = self::VERYLOW;
  30. /**
  31. * This represents Non-Cryptographic strengths. It should not be used any time
  32. * that security or confidentiality is at stake
  33. */
  34. const VERYLOW = 1;
  35. /**
  36. * This represents the bottom line of Cryptographic strengths. It may be used
  37. * for low security uses where some strength is required.
  38. */
  39. const LOW = 3;
  40. /**
  41. * This is the general purpose Cryptographical strength. It should be suitable
  42. * for all uses except the most sensitive.
  43. */
  44. const MEDIUM = 5;
  45. /**
  46. * This is the highest strength available. It should not be used unless the
  47. * high strength is needed, due to hardware constraints (and entropy
  48. * limitations).
  49. */
  50. const HIGH = 7;
  51. }