npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-native-cryptoswift

v1.1.0

Published

standard cryptographic functions with CryptoSwift on iOS

Downloads

164

Readme

react-native-cryptoswift

npm version npm downloads npm licence Platform

Fork from react-native-cryptography v0.0.2

Crypto e.g. "ase-128-ccm" is invalid (always say Error: CipherFactory.createCipher(...): Unknown cipher ase-128-ccm) on iOS with react-native-quick-crypto , so be this react-native-cryptoswift .

  • iOS CryptoSwift

  • Android BouncyCastle !TODO finish md5 and sha256!

Cryptoswift functions

Symetric ciphering

func | ios | android ----------|----------------------|-------------- AES CCM | ✓ | waiting PR AES GCM | ✓ | waiting PR AES 128 | waiting PR | ✓ AES 192 | waiting PR | ✓ AES 256 | waiting PR | ✓

  • AES 128 (pass 16 bytes key and iv)

  • AES 192 (pass 24 bytes key and iv)

  • AES 256 (pass 32 bytes key and iv)

Hashing

func | ios | android ----------|----------------------|-------------- MD5 | waiting PR | TODO SHA256 | waiting PR | TODO

Install

$ npm install react-native-cryptoswift --save

iOS: cd ios/ && pod install

Usage

import React, { Component } from 'react';
import { Button, StyleSheet, Text, TextInput, View } from 'react-native';
import CryptoSwift from 'react-native-cryptoswift';

const styles = StyleSheet.create({
  container: {
    flex: 1,
    marginTop: 50,
    justifyContent: 'flex-start',
    alignItems: 'center',
  },
});

export default class App extends Component {
  static AES_KEY_128 = Array.from('keykeykeykeykeyk').map(char => char.charCodeAt());
  static AES_IV = Array.from('drowssapdrow').map(char => char.charCodeAt());
  static AUTH_TAG_LENGTH = 4;

  encryptAesCcm() {
    const utf8text = 'Hello, I am the message to cipher';
    const plaintext = Array.from(utf8text).map(char => char.charCodeAt());
    CryptoSwift.encryptAesCcm(plaintext, App.AES_KEY_128, App.AES_IV, App.AUTH_TAG_LENGTH)
      .then(({ciphertext, authTag}) => {
        this.encrypted = {ciphertext, authTag};
        console.log(this.encrypted);
      })
      .catch(err => console.error(err));
  }

  decryptAesCcm() {
    CryptoSwift.decryptAesCcm(this.encrypted.ciphertext, App.AES_KEY_128, App.AES_IV, this.encrypted.authTag, App.AUTH_TAG_LENGTH)
      .then(plaintext => console.log(plaintext))
      .catch(err => console.error(err));
  }

  md5() {
    // CryptoSwift.md5('string to digest').then(digest => console.log(digest));
  }

  sha256() {
    // CryptoSwift.sha256('string to digest').then(digest => console.log(digest));
  }

  render() {
    return (
      <View style={styles.container}>
        <Button onPress={this.encryptAesCcm} title={'encrypt with AES'} />
        <Button onPress={this.decryptAesCcm} title={'decrypt AES'} />
        <Button onPress={this.md5} title={'MD5'} />
        <Button onPress={this.sha256} title={'SHA256'} />
      </View>
    );
  }
}