Packages

trait SecurityHelpers extends AnyRef

The SecurityHelpers trait provides functions to:

  • generate random numbers
  • generate keys
  • encrypt/decrypt keys
  • create SHA, SHA-256, MD5 hashes (can be hex encoded)
Self Type
SecurityHelpers with StringHelpers with IoHelpers
Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. SecurityHelpers
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def base64Decode(in: String): Array[Byte]

    decode a String in Base 64

  6. def base64Encode(in: Array[Byte]): String

    encode a Byte array in Base 64

  7. def base64EncodeURLSafe(in: Array[Byte]): String

    encode a Byte array in Base 64 in a way that's safe for use in URLs

  8. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  10. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  11. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
  13. def hash(in: String): String

    create a SHA hash from a String

  14. def hash(in: Array[Byte]): Array[Byte]

    create a SHA hash from a Byte array

  15. def hash256(in: String): String

    create a SHA-256 hash from a String

  16. def hash256(in: Array[Byte]): Array[Byte]

    create a SHA-256 hash from a Byte array

  17. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  18. def hashHex(in: String): String

    create a SHA hash from a String

  19. def hexDecode(str: String): Array[Byte]
  20. def hexDigest(in: Array[Byte]): String

    create a hex encoded SHA hash from a Byte array

  21. def hexDigest256(in: Array[Byte]): String

    create a hex encoded SHA-256 hash from a Byte array

  22. def hexEncode(in: Array[Byte]): String

    encode a Byte array as hexadecimal characters

  23. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  24. def md5(in: String): String

    create a MD5 digest from a String

  25. def md5(in: Array[Byte]): Array[Byte]

    create a MD5 digest from a Byte array

  26. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  27. final def notify(): Unit
    Definition Classes
    AnyRef
  28. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  29. def randomInt(mod: Int): Int

    return a random int modulo a number

  30. def randomLong(mod: Long): Long

    return a random Long modulo a number

  31. def secureEquals(s1: Array[Byte], s2: Array[Byte]): Boolean

    Compare two byte arrays in a way that does not vary if the arrays are determined to be not equal early (test every byte...

    Compare two byte arrays in a way that does not vary if the arrays are determined to be not equal early (test every byte... avoids timing attacks

  32. def secureEquals(s1: String, s2: String): Boolean

    Compare two strings in a way that does not vary if the strings are determined to be not equal early (test every byte...

    Compare two strings in a way that does not vary if the strings are determined to be not equal early (test every byte... avoids timing attacks

  33. def secureXML: XMLLoader[Elem]

    Provides a secure XML parser, similar to the one provided by scala.xml.XML, but with external entities and doctypes disabled and secure XML processing enabled.

    Provides a secure XML parser, similar to the one provided by scala.xml.XML, but with external entities and doctypes disabled and secure XML processing enabled. This prevents XXE (XML External Entities) attacks, billion laughs attacks, quadratic blowup attacks, and others. It is used internally throughout Lift, and should be used by anyone who is parsing XML from an untrusted source.

  34. def shouldShow(percent: Double): Boolean

    return true only 'percent' times when asked repeatedly.

    return true only 'percent' times when asked repeatedly. This function is used in the Skittr example to get a random set of users

    percent

    percentage as a double number <= 1.0

  35. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  36. def toString(): String
    Definition Classes
    AnyRef → Any
  37. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  38. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  39. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped