@particle/react-native-crypto
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

@particle/react-native-crypto

React Native compatible crypto functions

Installation

npm install @particle/react-native-crypto --save

NOTE: @particle/react-native-crypto declares react-native and @particle/device-constants as a peerDependency - this ensures your app only ever has one copy of those dependencies

API

ReactNativeAes128Cipher

A React Native class for an AES-128 cipher operating in ECB mode.

Kind: global class


reactNativeAes128Cipher.encryptBlock(block) ⇒ Promise.<Uint8Array>

Encrypt a single block of data.

Kind: instance method of ReactNativeAes128Cipher
Returns: Promise.<Uint8Array> - Ciphertext block.

Param Type Description
block Uint8Array Plaintext block. The block must be 16 bytes long.

ReactNativeEnv

A React Native environment class.

Kind: global class


reactNativeEnv.createAes128Cipher(key) ⇒ Aes128Cipher

Create an AES-128 cipher operating in ECB mode.

Kind: instance method of ReactNativeEnv
Returns: Aes128Cipher - Cipher object.

Param Type Description
key Uint8Array Encryption key. The key must be 16 bytes long.

reactNativeEnv.getRandomBytes(size) ⇒ Promise.<Uint8Array>

Generate cryptographically strong random data.

Kind: instance method of ReactNativeEnv
Returns: Promise.<Uint8Array> - Random data.

Param Type Description
size Number Number of bytes to generate.

NOTE: Unfortunately, docs have a nasty habit of falling out of date. When in doubt, check usage in tests

Readme

Keywords

none

Package Sidebar

Install

npm i @particle/react-native-crypto

Weekly Downloads

4

Version

1.0.4

License

UNLICENSED

Unpacked Size

6.89 kB

Total Files

5

Last publish

Collaborators

  • jackson-particle
  • mike.grundy.npm
  • mohitparticle
  • eugene_particle
  • kmok23
  • karlag
  • cole-abbeduto-particle
  • pedrosordo
  • guohui
  • sbrust
  • particlebot
  • no1089
  • carlos.hdez
  • keeramis5
  • monkbroc
  • suda
  • mstan
  • sergeuz
  • debbie23
  • avtolstoy
  • mlauer
  • wraithan
  • azenk
  • bwalach
  • parteberseth
  • rickkas7
  • mrlambchop_particle
  • hugo.montero
  • mphsi