• Stars
    star
    242
  • Rank 166,664 (Top 4 %)
  • Language
    Java
  • License
    MIT License
  • Created over 3 years ago
  • Updated 11 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

AES-GCM encryption/decryption for React Native

react-native-aes-gcm-crypto

AES-GCM encryption/decryption for React Native

Requirements

  • iOS >= 13.0
  • Android >= 26

Installation

npm install react-native-aes-gcm-crypto

Usage

import AesGcmCrypto from 'react-native-aes-gcm-crypto';

const key = 'Yzg1MDhmNDYzZjRlMWExOGJkNTk5MmVmNzFkOGQyNzk=';

AesGcmCrypto.decrypt(
  'LzpSalRKfL47H5rUhqvA',
  key,
  '131348c0987c7eece60fc0bc',
  '5baa85ff3e7eda3204744ec74b71d523',
  false
).then((decryptedData) => {
  console.log(decryptedData);
});

AesGcmCrypto.encrypt('{"name":"Hoge"}', false, key).then((result) => {
  console.log(result);
});

Encrypt data

type EncryptedData = {
  iv: string;
  tag: string;
  content: string;
};

function encrypt(
  plainText: string,
  inBinary: boolean,
  key: string
): Promise<EncryptedData>;
  • plainText: A string data to encrypt. If inBinary is true, it should be encoded in Base64.
  • inBinary: true to encrypt binary data encoded with Base64
  • key: AES key in Base64

Encrypt file

function encryptFile(
  inputFilePath: string,
  outputFilePath: string,
  key: string
): Promise<{
  iv: string;
  tag: string;
}>;
  • inputFilePath: A file path to encrypt
  • outputFilePath: An output file path
  • key: AES key in Base64

Decrypt data

function decrypt(
  base64Ciphertext: string,
  key: string,
  iv: string,
  tag: string,
  isBinary: boolean
): Promise<string>;
  • base64Ciphertext: A base64 data to decrypt.
  • key: AES key in Base64
  • iv: An initialization vector
  • tag: An auth tag
  • isBinary: true to return decrypted data in Base64

Decrypt file

function decrypt(
  inputFilePath: string,
  outputFilePath: string,
  key: string,
  iv: string,
  tag: string
): Promise<boolean>;
  • inputFilePath: A file path to decrypt
  • outputFilePath: An output file path
  • key: AES key in Base64
  • iv: An initialization vector
  • tag: An auth tag
  • isBinary: true to return decrypted data in Base64

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

Author

Takuya Matsuyama | @inkdrop_app

Made for my app called Inkdrop - A Markdown note-taking app

License

MIT

More Repositories

1

dotfiles-public

My personal dotfiles
Lua
6,132
star
2

craftzdog-homepage

My homepage
JavaScript
2,257
star
3

chat-bubbles-for-yt

Real-time recording for chat bubbles
TypeScript
658
star
4

solarized-osaka.nvim

🏯 A clean, dark Neovim theme written in Lua, with support for lsp, treesitter and lots of plugins.
Lua
595
star
5

react-native-animated-todo

Animated ToDo app built with React Native and Reanimated v2
TypeScript
444
star
6

react-native-sqlite-2

SQLite3 Native Plugin for React Native for iOS, Android, Windows and macOS.
TypeScript
376
star
7

react-native-quick-base64

A fast base64 module for React Native
TypeScript
354
star
8

electron-markdown-editor-tutorial

Electron Markdown editor tutorial
JavaScript
298
star
9

craftzdog-uses

A curated list of the tech I use, built with Astro and Tailwind CSS
Astro
251
star
10

inkdrop-ui-mockup-react-native

A mockup for Inkdrop mobile inspired by Gmail
TypeScript
236
star
11

react-native-checkbox-reanimated

Animated checkbox built with Reanimated v2
TypeScript
165
star
12

link-in-bio

Link in bio page for my Instagram profile
HTML
165
star
13

ghibli-style-shader

Ghibli-styled Shader Example for Three.js
JavaScript
150
star
14

vlog-translator

A Personal Tool for Transcribing & Translating My Vlogs into Japanese
TypeScript
144
star
15

pouchdb-adapter-react-native-sqlite

PouchDB adapter using ReactNative SQLite as its backing store
JavaScript
116
star
16

react-native-quick-md5

Fast C++ implementation with JSI binding of MD5 for React Native
C++
106
star
17

caffe-ios-sample

An example of XCode project using Caffe: a fast open framework for deep learning
Objective-C++
98
star
18

ZenPlayer-for-iOS

ZenPlayer written with objective-c
Objective-C
91
star
19

hyper-holoplay

Holoplay integration for Hyper
JavaScript
82
star
20

cm6-themes

Themes for CodeMirror 6
TypeScript
80
star
21

voxel-dog

A cute 3D dog rendered with three.js
TypeScript
71
star
22

send-email-lambda

Simple email sender running on Lambda
JavaScript
69
star
23

react-native-three-column-layout

Three-column layout with animation support for tablet displays
TypeScript
48
star
24

react-native-quick-websql

Fast WebSQL-compatible SQLite driver for React Native
TypeScript
44
star
25

NRBlurryStepOutAnimatedTransitioning

tweetbot like modal view transitioning
Objective-C
42
star
26

react-native-skeuomorphism-ui-example

Neo-skeuomorphism style UI Example for React Native
JavaScript
38
star
27

p5-wave-visualization

p5 sketch visualizing the sound of waves of the sea recorded at Yuigahama in Kamakura, which is processed with FFT.
JavaScript
36
star
28

react-native-japanese-tokenizer

Async Japanese Tokenizer Native Plugin for React Native for iOS and Android
Java
34
star
29

smooth-toc-example

A demo project of a smoothly animated table of contents
CSS
30
star
30

react-codemirror-runmode

Syntax highlighting for react, utilizing CodeMirror's parser
TypeScript
27
star
31

presentation-themes

Presentation themes based on popular syntax themes
19
star
32

gatsby-starter-ionic

A Gatsby starter with Ionic added on top
CSS
17
star
33

atom-react-app

An empty React app based on Atom Editor
JavaScript
16
star
34

pouchdb-react-native-demo

A working demo for PouchDB on React Native with SQLite3 storage
JavaScript
15
star
35

extract-main-text-node

ExtractContent for node.js
JavaScript
15
star
36

react-native-native-ui-component-boilerplate

My boilerplate for building a native UI component for React Native
Java
13
star
37

remark-react-codemirror

Syntax highlighting for remark-react through CodeMirror
JavaScript
11
star
38

remark-strip-html

Remove html formatting from Markdown
JavaScript
11
star
39

anavi-phat-sensors-ui

Web interface for ANAVI pHAT & CO2 sensors
CSS
10
star
40

react-native-sqlite-2-demo

React Native SQLite 2 Demo
JavaScript
5
star
41

anavi-sensors-api

An API server to retrieve ANAVI sensor data from my Raspberry Pi
JavaScript
4
star
42

rn-tamagui-web-test

TypeScript
4
star
43

lunr-language-jp

A Japanese tokenizer and stopwords for Lunr JavaScript library
JavaScript
3
star
44

frosted-top-bar-example

an example of iOS like frosted blurry-styled top-bar on the web
HTML
3
star
45

raspcon

A remote controller server for my room πŸ•Ή
JavaScript
2
star
46

twit-promise

A wrapper for the Twit module that its get/post methods return the native promise
JavaScript
2
star
47

NRJSONHelpers

Handy categories for encoding/decoding JSON in Objective-C
Objective-C
1
star
48

codemirror.next-markdown

Markdown test
1
star
49

electron-acrylic-window-drag-issue-reproduction

JavaScript
1
star
50

react-native-pouchdb-md5

PouchDB utilities for calculating MD5 checksums for React Native
Java
1
star