object Crypto extends Object with Crypto

Crypto Singleton

Annotations
@native() @JSImport("crypto", JSImport.Namespace)
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Crypto
  2. Crypto
  3. Object
  4. Any
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. type Cipher = crypto.Cipher
  2. type Decipher = crypto.Decipher
  3. type DiffieHellman = crypto.DiffieHellman
  4. type ECDH = crypto.ECDH
  5. type Hash = crypto.Hash
  6. type Hmac = crypto.Hmac
  7. type Sign = crypto.Sign
  8. type Verify = crypto.Verify

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 clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  6. val constants: Constants.type
  7. def createCipheriv(algorithm: String, key: BufferLike, iv: BufferLike): crypto.Cipher
    Definition Classes
    Crypto
  8. def createCipheriv(algorithm: String, key: BufferLike, iv: String, options: TransformOptions): crypto.Cipher
    Definition Classes
    Crypto
  9. def createCipheriv(algorithm: String, key: String, iv: BufferLike): crypto.Cipher
    Definition Classes
    Crypto
  10. def createCipheriv(algorithm: String, key: String, iv: String, options: TransformOptions): crypto.Cipher
    Definition Classes
    Crypto
  11. def createDecipheriv(algorithm: String, key: KeyObject, iv: BufferLike): crypto.Decipher
    Definition Classes
    Crypto
  12. def createDecipheriv(algorithm: String, key: KeyObject, iv: String): crypto.Decipher
    Definition Classes
    Crypto
  13. def createDecipheriv(algorithm: String, key: KeyObject, iv: BufferLike, options: TransformOptions): crypto.Decipher
    Definition Classes
    Crypto
  14. def createDecipheriv(algorithm: String, key: KeyObject, iv: String, options: TransformOptions): crypto.Decipher
    Definition Classes
    Crypto
  15. def createDecipheriv(algorithm: String, key: BufferLike, iv: BufferLike): crypto.Decipher
    Definition Classes
    Crypto
  16. def createDecipheriv(algorithm: String, key: BufferLike, iv: String): crypto.Decipher
    Definition Classes
    Crypto
  17. def createDecipheriv(algorithm: String, key: String, iv: BufferLike, options: TransformOptions): crypto.Decipher
    Definition Classes
    Crypto
  18. def createDecipheriv(algorithm: String, key: String, iv: String, options: TransformOptions): crypto.Decipher
    Definition Classes
    Crypto
  19. def createDiffieHellman(primeLength: Int, generator: Int): crypto.DiffieHellman
    Definition Classes
    Crypto
  20. def createDiffieHellman(prime: BufferLike, generator: BufferLike): crypto.DiffieHellman
    Definition Classes
    Crypto
  21. def createDiffieHellman(prime: BufferLike, generator: Int): crypto.DiffieHellman
    Definition Classes
    Crypto
  22. def createDiffieHellman(prime: BufferLike, generator: String, generatorEncoding: String): crypto.DiffieHellman
    Definition Classes
    Crypto
  23. def createDiffieHellman(prime: String, primeEncoding: String, generator: String, generatorEncoding: String): crypto.DiffieHellman
    Definition Classes
    Crypto
  24. def createDiffieHellman(prime: String, primeEncoding: String, generator: BufferLike): crypto.DiffieHellman
    Definition Classes
    Crypto
  25. def createDiffieHellman(prime: String, primeEncoding: String, generator: Int): crypto.DiffieHellman
    Definition Classes
    Crypto
  26. def createDiffieHellmanGroup(name: String): crypto.DiffieHellman
    Definition Classes
    Crypto
  27. def createECDH(curveName: String): crypto.ECDH
    Definition Classes
    Crypto
  28. def createHash(algorithm: String): crypto.Hash
    Definition Classes
    Crypto
  29. def createHash(algorithm: String, options: CreateHashOptions): crypto.Hash
    Definition Classes
    Crypto
  30. def createHmac(algorithm: String, key: BufferLike): crypto.Hmac
    Definition Classes
    Crypto
  31. def createHmac(algorithm: String, key: String): crypto.Hmac
    Definition Classes
    Crypto
  32. def createHmac(algorithm: String, key: BufferLike, options: TransformOptions): crypto.Hmac
    Definition Classes
    Crypto
  33. def createHmac(algorithm: String, key: String, options: TransformOptions): crypto.Hmac

    Creates and returns an Hmac object that uses the given algorithm and key.

    Creates and returns an Hmac object that uses the given algorithm and key.

    The algorithm is dependent on the available algorithms supported by the version of OpenSSL on the platform. Examples are 'sha256', 'sha512', etc. On recent releases of OpenSSL, openssl list-message-digest-algorithms will display the available digest algorithms.

    algorithm

    the given algorithm (e.g. 'sha256', 'sha512')

    key

    The key is the HMAC key used to generate the cryptographic HMAC hash.

    Definition Classes
    Crypto
  34. def createSign(algorithm: String): crypto.Sign
    Definition Classes
    Crypto
  35. def createSign(algorithm: String, options: WritableOptions): crypto.Sign

    Creates and returns a Sign object that uses the given algorithm.

    Creates and returns a Sign object that uses the given algorithm. On recent OpenSSL releases, openssl list-public-key-algorithms will display the available signing algorithms. One example is 'RSA-SHA256'.

    algorithm

    the given algorithm (e.g. 'RSA-SHA256')

    Definition Classes
    Crypto
  36. def createVerify(algorithm: String): crypto.Verify
    Definition Classes
    Crypto
  37. def createVerify(algorithm: String, options: WritableOptions): crypto.Verify

    Creates and returns a Verify object that uses the given algorithm.

    Creates and returns a Verify object that uses the given algorithm. On recent OpenSSL releases, openssl list-public-key-algorithms will display the available signing algorithms. One example is 'RSA-SHA256'.

    algorithm

    the given algorithm (e.g. 'RSA-SHA256')

    Definition Classes
    Crypto
  38. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  39. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  40. def generateKeyPair(type: String, options: GenerateKeyPairOptions, callback: Callback2[|[|[String, Buffer], KeyObject], |[|[String, Buffer], KeyObject]]): Unit
    Definition Classes
    Crypto
  41. def generateKeyPairSync(type: String, options: GenerateKeyPairOptions): KeyPair
    Definition Classes
    Crypto
  42. def getCiphers(): Array[String]

    Returns an array with the names of the supported cipher algorithms.

    Returns an array with the names of the supported cipher algorithms.

    returns

    the names of the supported cipher algorithms. // ['aes-128-cbc', 'aes-128-ccm', ...]

    Definition Classes
    Crypto
  43. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  44. def getCurves(): Array[String]
    Definition Classes
    Crypto
  45. def getDiffieHellman(groupName: String): DiffieHellmanGroup
    Definition Classes
    Crypto
  46. def getFips(): Boolean
    Definition Classes
    Crypto
  47. def getHashes(): Array[String]
    Definition Classes
    Crypto
  48. def hasOwnProperty(v: String): Boolean
    Definition Classes
    Object
  49. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  50. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  51. def isPrototypeOf(v: Object): Boolean
    Definition Classes
    Object
  52. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  53. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  54. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  55. def pbkdf2(password: BufferLike, salt: BufferLike, iterations: Int, keylen: Int, digest: String, callback: Callback1[Buffer]): Buffer
    Definition Classes
    Crypto
  56. def pbkdf2(password: BufferLike, salt: String, iterations: Int, keylen: Int, digest: String, callback: Callback1[Buffer]): Buffer
    Definition Classes
    Crypto
  57. def pbkdf2(password: String, salt: BufferLike, iterations: Int, keylen: Int, digest: String, callback: Callback1[Buffer]): Buffer
    Definition Classes
    Crypto
  58. def pbkdf2(password: String, salt: String, iterations: Int, keylen: Int, digest: String, callback: Callback1[Buffer]): Buffer
    Definition Classes
    Crypto
  59. def pbkdf2Sync(password: BufferLike, salt: BufferLike, iterations: Int, keylen: Int, digest: String): Buffer
    Definition Classes
    Crypto
  60. def pbkdf2Sync(password: BufferLike, salt: String, iterations: Int, keylen: Int, digest: String): Buffer
    Definition Classes
    Crypto
  61. def pbkdf2Sync(password: String, salt: BufferLike, iterations: Int, keylen: Int, digest: String): Buffer
    Definition Classes
    Crypto
  62. def pbkdf2Sync(password: String, salt: String, iterations: Int, keylen: Int, digest: String): Buffer

    Provides a synchronous Password-Based Key Derivation Function 2 (PBKDF2) implementation.

    Provides a synchronous Password-Based Key Derivation Function 2 (PBKDF2) implementation. A selected HMAC digest algorithm specified by digest is applied to derive a key of the requested byte length (keylen) from the password, salt and iterations.

    If an error occurs an Error will be thrown, otherwise the derived key will be returned as a Buffer.

    The iterations argument must be a number set as high as possible. The higher the number of iterations, the more secure the derived key will be, but will take a longer amount of time to complete.

    The salt should also be as unique as possible. It is recommended that the salts are random and their lengths are greater than 16 bytes. See NIST SP 800-132 for details.

    (Doc source: https://nodejs.org/api/crypto.html#crypto_crypto_pbkdf2sync_password_salt_iterations_keylen_digest)

    Definition Classes
    Crypto
  63. def privateDecrypt(privateKey: Buffer, buffer: BufferLike): Buffer
    Definition Classes
    Crypto
  64. def privateDecrypt(privateKey: String, buffer: BufferLike): Buffer
    Definition Classes
    Crypto
  65. def privateEncrypt(privateKey: Buffer, buffer: BufferLike): Buffer
    Definition Classes
    Crypto
  66. def privateEncrypt(privateKey: String, buffer: BufferLike): Buffer
    Definition Classes
    Crypto
  67. def propertyIsEnumerable(v: String): Boolean
    Definition Classes
    Object
  68. def publicDecrypt(key: Buffer, buffer: BufferLike): Buffer
    Definition Classes
    Crypto
  69. def publicDecrypt(key: String, buffer: BufferLike): Buffer
    Definition Classes
    Crypto
  70. def publicEncrypt(key: Buffer, buffer: BufferLike): Buffer
    Definition Classes
    Crypto
  71. def publicEncrypt(key: String, buffer: BufferLike): Buffer
    Definition Classes
    Crypto
  72. def randomBytes(size: Int, callback: Callback1[Buffer]): Unit
    Definition Classes
    Crypto
  73. def randomBytes(size: Int): Buffer
    Definition Classes
    Crypto
  74. def randomFill[T <: TypedArray[_, T]](buffer: T, callback: Callback1[T]): T
    Definition Classes
    Crypto
  75. def randomFill[T <: TypedArray[_, T]](buffer: T, offset: Int, callback: Callback1[T]): T
    Definition Classes
    Crypto
  76. def randomFill[T <: TypedArray[_, T]](buffer: T, offset: Int, size: Int, callback: Callback1[T]): T
    Definition Classes
    Crypto
  77. def randomFill(buffer: DataView, callback: Callback1[DataView]): DataView
    Definition Classes
    Crypto
  78. def randomFill(buffer: DataView, offset: Int, callback: Callback1[DataView]): DataView
    Definition Classes
    Crypto
  79. def randomFill(buffer: DataView, offset: Int, size: Int, callback: Callback1[DataView]): DataView
    Definition Classes
    Crypto
  80. def randomFill(buffer: Buffer, callback: Callback1[Buffer]): Buffer
    Definition Classes
    Crypto
  81. def randomFill(buffer: Buffer, offset: Int, callback: Callback1[Buffer]): Buffer
    Definition Classes
    Crypto
  82. def randomFill(buffer: Buffer, offset: Int, size: Int, callback: Callback1[Buffer]): Buffer
    Definition Classes
    Crypto
  83. def randomFillSync[T <: TypedArray[_, T]](buffer: T): T
    Definition Classes
    Crypto
  84. def randomFillSync[T <: TypedArray[_, T]](buffer: T, offset: Int): T
    Definition Classes
    Crypto
  85. def randomFillSync[T <: TypedArray[_, T]](buffer: T, offset: Int, size: Int): T
    Definition Classes
    Crypto
  86. def randomFillSync(buffer: DataView): DataView
    Definition Classes
    Crypto
  87. def randomFillSync(buffer: DataView, offset: Int): DataView
    Definition Classes
    Crypto
  88. def randomFillSync(buffer: DataView, offset: Int, size: Int): DataView
    Definition Classes
    Crypto
  89. def randomFillSync(buffer: Buffer): Buffer
    Definition Classes
    Crypto
  90. def randomFillSync(buffer: Buffer, offset: Int): Buffer
    Definition Classes
    Crypto
  91. def randomFillSync(buffer: Buffer, offset: Int, size: Int): Buffer
    Definition Classes
    Crypto
  92. def scrypt(password: BufferLike, salt: BufferLike, keylen: Int, callback: Callback1[Buffer]): Unit
    Definition Classes
    Crypto
  93. def scrypt(password: BufferLike, salt: String, keylen: Int, callback: Callback1[Buffer]): Unit
    Definition Classes
    Crypto
  94. def scrypt(password: String, salt: BufferLike, keylen: Int, callback: Callback1[Buffer]): Unit
    Definition Classes
    Crypto
  95. def scrypt(password: String, salt: String, keylen: Int, callback: Callback1[Buffer]): Unit
    Definition Classes
    Crypto
  96. def scrypt(password: BufferLike, salt: BufferLike, keylen: Int, options: ScryptOptions, callback: Callback1[Buffer]): Unit
    Definition Classes
    Crypto
  97. def scrypt(password: BufferLike, salt: String, keylen: Int, options: ScryptOptions, callback: Callback1[Buffer]): Unit
    Definition Classes
    Crypto
  98. def scrypt(password: String, salt: BufferLike, keylen: Int, options: ScryptOptions, callback: Callback1[Buffer]): Unit
    Definition Classes
    Crypto
  99. def scrypt(password: String, salt: String, keylen: Int, options: ScryptOptions, callback: Callback1[Buffer]): Unit
    Definition Classes
    Crypto
  100. def scryptSync(password: BufferLike, salt: BufferLike, keylen: Int): Buffer
    Definition Classes
    Crypto
  101. def scryptSync(password: BufferLike, salt: String, keylen: Int): Buffer
    Definition Classes
    Crypto
  102. def scryptSync(password: String, salt: BufferLike, keylen: Int): Buffer
    Definition Classes
    Crypto
  103. def scryptSync(password: String, salt: String, keylen: Int): Buffer
    Definition Classes
    Crypto
  104. def scryptSync(password: BufferLike, salt: BufferLike, keylen: Int, options: ScryptOptions): Buffer
    Definition Classes
    Crypto
  105. def scryptSync(password: BufferLike, salt: String, keylen: Int, options: ScryptOptions): Buffer
    Definition Classes
    Crypto
  106. def scryptSync(password: String, salt: BufferLike, keylen: Int, options: ScryptOptions): Buffer
    Definition Classes
    Crypto
  107. def scryptSync(password: String, salt: String, keylen: Int, options: ScryptOptions): Buffer
    Definition Classes
    Crypto
  108. def setEngine(engine: String): Unit
    Definition Classes
    Crypto
  109. def setEngine(engine: String, fips: Int): Unit
    Definition Classes
    Crypto
  110. def setFips(enable: Boolean): Unit
    Definition Classes
    Crypto
  111. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  112. def timingSafeEqual(a: BufferLike, b: BufferLike): Boolean
    Definition Classes
    Crypto
  113. def toLocaleString(): String
    Definition Classes
    Object
  114. def toString(): String
    Definition Classes
    AnyRef → Any
  115. def valueOf(): Any
    Definition Classes
    Object
  116. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  117. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  118. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. val DEFAULT_ENCODING: String

    The default encoding to use for functions that can take either strings or buffers.

    The default encoding to use for functions that can take either strings or buffers. The default value is 'buffer', which makes methods default to Buffer objects.

    The crypto.DEFAULT_ENCODING mechanism is provided for backwards compatibility with legacy programs that expect 'binary' to be the default encoding.

    Definition Classes
    Crypto
    Annotations
    @deprecated
    Deprecated

    (Since version Node.js v10.0) New applications should expect the default to be 'buffer'.

  2. def createCipher(algorithm: String, password: String): crypto.Cipher
    Definition Classes
    Crypto
    Annotations
    @deprecated
    Deprecated

    (Since version Node.js v10.0) Use crypto.createCipheriv() instead.

  3. def createCipher(algorithm: String, password: Buffer): crypto.Cipher

    Creates and returns a Cipher object that uses the given algorithm and password.

    Creates and returns a Cipher object that uses the given algorithm and password.

    algorithm

    The algorithm is dependent on OpenSSL, examples are 'aes192', etc. On recent OpenSSL releases, openssl list-cipher-algorithms will display the available cipher algorithms.

    password

    The password is used to derive the cipher key and initialization vector (IV). The value must be either a 'binary' encoded string or a Buffer.

    Definition Classes
    Crypto
    Annotations
    @deprecated
    Deprecated

    (Since version Node.js v10.0) Use crypto.createCipheriv() instead.

    Example:
    1. crypto.createCipher(algorithm, password)

  4. def createDecipher(algorithm: String, password: String): crypto.Decipher
    Definition Classes
    Crypto
    Annotations
    @deprecated
    Deprecated

    (Since version Node.js v10.0) Use crypto.createDecipheriv() instead.

  5. def createDecipher(algorithm: String, password: Buffer): crypto.Decipher

    Creates and returns a Decipher object that uses the given algorithm and password (key).

    Creates and returns a Decipher object that uses the given algorithm and password (key). The implementation of crypto.createDecipher() derives keys using the OpenSSL function EVP_BytesToKey with the digest algorithm set to MD5, one iteration, and no salt. The lack of salt allows dictionary attacks as the same password always creates the same key. The low iteration count and non-cryptographically secure hash algorithm allow passwords to be tested very rapidly.

    In line with OpenSSL's recommendation to use pbkdf2 instead of EVP_BytesToKey it is recommended that developers derive a key and IV on their own using crypto.pbkdf2() and to use crypto.createDecipheriv() to create the Decipher object.

    Definition Classes
    Crypto
    Annotations
    @deprecated
    Deprecated

    (Since version Node.js v10.0) Use crypto.createDecipheriv() instead.

    Example:
    1. crypto.createDecipher(algorithm, password)

  6. def createHash(algorithm: String, options: TransformOptions): crypto.Hash

    Creates and returns a Hash object that can be used to generate hash digests using the given algorithm.

    Creates and returns a Hash object that can be used to generate hash digests using the given algorithm.

    The algorithm is dependent on the available algorithms supported by the version of OpenSSL on the platform. Examples are 'sha256', 'sha512', etc. On recent releases of OpenSSL, openssl list-message-digest-algorithms will display the available digest algorithms.

    algorithm

    the given algorithm (e.g. 'sha256', 'sha512')

    Definition Classes
    Crypto
    Annotations
    @deprecated
    Deprecated

    (Since version v0.12.0) Use CreateHashOptions instead.

  7. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated
  8. val fips: Boolean

    Property for checking and controlling whether a FIPS compliant crypto provider is currently in use.

    Property for checking and controlling whether a FIPS compliant crypto provider is currently in use. Setting to true requires a FIPS build of Node.js.

    Definition Classes
    Crypto
    Annotations
    @deprecated
    Deprecated

    (Since version Node.js v10.0) Please use crypto.setFips() and crypto.getFips() instead.

Inherited from Crypto

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped