final class Crypto extends Logging
A Simple Crypto Class
NOTE: Use at your own risk. We make no claim that any of this Crypto code is correct.
- Source
- Crypto.scala
- Alphabetic
- By Inheritance
- Crypto
- Logging
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- def decrypt(iv: Array[Byte], ciphertext: Array[Byte]): Array[Byte]
Decrypt given the IV and Ciphertext
- def decrypt(ivAndCiphertext: Array[Byte]): Array[Byte]
Decrypt given the combined IV and Ciphertext
- def decryptBase64(base64IvAndCiphertext: String): Array[Byte]
Decrypt a string encrypted using encryptBase64()
- def decryptBase64String(base64IvAndCiphertext: String): String
Decrypt a string encrypted using encryptBase64String()
- def encrypt(plaintext: Array[Byte]): Array[Byte]
Encrypt bytes returning the iv and ciphertext combined into a single byte array (iv followed by the cipher text)
- def encryptBase64(bytes: Array[Byte], urlSafe: Boolean): String
- def encryptBase64(bytes: Array[Byte]): String
- def encryptBase64String(plaintext: String, urlSafe: Boolean): String
- def encryptBase64String(plaintext: String): String
- def encryptBase64StringURLSafe(plaintext: String): String
- def encryptBase64URLSafe(bytes: Array[Byte]): String
- def encryptRaw(plaintext: Array[Byte]): (Array[Byte], Array[Byte])
Encrypt Bytes returning the tuple: (iv, ciphertext)
- def encryptRaw(plaintext: String): (Array[Byte], Array[Byte])
Encrypt a string returning the tuple: (iv, ciphertext)
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- lazy val logger: Logger
- Attributes
- protected
- Definition Classes
- Logging
- Annotations
- @transient()
- def mac(data: Array[Byte]): Array[Byte]
Calculate the MAC for an array of bytes
- def macBase64(data: Array[Byte], urlSafe: Boolean): String
- def macBase64(data: Array[Byte]): String
The Base64 Encoded MAC for an array of bytes
- def macBase64(data: String, urlSafe: Boolean): String
- def macBase64(data: String): String
- def macBase64URLSafe(data: Array[Byte]): String
- def macBase64URLSafe(data: String): String
- def macHex(data: Array[Byte]): String
The Hex Encoded MAC for an array of bytes
- def macHex(data: String): String
The Hex Encoded MAC for a String
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def tryDecrypt(iv: Array[Byte], ciphertext: Array[Byte]): Option[Array[Byte]]
- def tryDecrypt(ivAndCiphertext: Array[Byte]): Option[Array[Byte]]
- def tryDecryptBase64String(base64IvAndCiphertext: String): Option[String]
Attempt to decrypt a string encrypted using encryptBase64String()
Attempt to decrypt a string encrypted using encryptBase64String()
If successful then Some(plaintext) will be returned. Otherwise None will be returned.
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])