Skip to content

An NPM library designed to encrypt/decrypt QR codes. This project is part of a series, in which I innovate around the possibilities with QR technology.

Notifications You must be signed in to change notification settings

alexandersteele/qr-code-encryption

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

qr-code-encryption

npm NPM node

Install

npm install qr-code-encryption

Usage

Encrypt QR Codes

To encrypt data into a QR code:

  • Insert the desired image location (if placed in a subfolder, please create this yourself) as the first parameter
  • Insert the data (or message) as the second parameter
  • (optional: Add a secret key as the third parameter - if not set, the qr is not encrypted)
  • (optional: add a callback to execute after the encryption has finished)
const { encryptQR } = require('qr-code-encryption');
encryptQR('code_images/encrypted_code.png', "hi bradley", "abcdef").then(() => {
    //code
})

Decrypt QR Codes

To decrypt a QR code:

  • Insert the desired image location (if placed in a subfolder, please create this yourself) as the first parameter
  • Add a secret key as the second parameter
  • Add a callback to extract the message
const {decryptQR} = require('qr-code-encryption');
decryptQR('code_images/encrypted_code.png', "abcdef").then((msg) => console.log(msg))

About

An NPM library designed to encrypt/decrypt QR codes. This project is part of a series, in which I innovate around the possibilities with QR technology.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published