Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

hans-files-cryptor

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hans-files-cryptor

file cryptor with hans-cryptor

latest
Source
npmnpm
Version
1.0.2
Version published
Weekly downloads
4
-50%
Maintainers
1
Weekly downloads
 
Created
Source

hans-files-cryptor

file cryptor with hans-cryptor for node.js

Table of contents

  • Features
  • Installing
  • Example

Features

  • encrypting and decrypting strings by password using Vigenere method

Installing

Add the package to your project

npm i hans-files-cryptor

Example

Export fileCrypt from hans-files-cryptor

const fileCrypt = require('hans-files-cryptor')

using TypeScript

import fileCrypt from 'hans-files-cryptor'

encryptObjectAndWriteTextFile

type UserType = {id: string, name: string}
const obj = {id: 'spme id', name: 'Hans'}
const filePath = './encryptedFiles/hansUser.dat'
const key = 'some key'
encryptObjectAndWriteTextFile(obj, filePath, key)

decryptTextFileAndParse

const obj = decryptTextFileAndParse<UserType>(filePath, key)
console.log(obj) // Object {id: string, name: string}

Keywords

crypt

FAQs

Package last updated on 29 Nov 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts