# crypticstorage

> Browser & Server compatible encrypted storage

Latest version **0.0.2** (published 2024-01-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install crypticstorage
pnpm add crypticstorage
yarn add crypticstorage
bun add crypticstorage
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2024-01-21 |
| First published | 2023-09-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 17.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | jojobyte |
| Maintainers | jojobyte |
| Keywords | localStorage, sessionStorage, encryption, crypto |

## Links

- npm: https://www.npmjs.com/package/crypticstorage
- Repository: https://github.com/dashhive/CrypticStorage
- Homepage: https://github.com/dashhive/CrypticStorage#readme
- Issues: https://github.com/dashhive/CrypticStorage/issues
- npm.io page: https://npm.io/package/crypticstorage

## Alternatives

- [@gemini-wallet/core](https://npm.io/package/@gemini-wallet/core.md) — 515.6K weekly downloads
- [utility](https://npm.io/package/utility.md) — 416.6K weekly downloads
- [@primno/dpapi](https://npm.io/package/@primno/dpapi.md) — 7.2K weekly downloads
- [pi-readseek](https://npm.io/package/pi-readseek.md) — 3.7K weekly downloads
- [@emilia-protocol/verify](https://npm.io/package/@emilia-protocol/verify.md) — 1.1K weekly downloads

## Recent versions

- 0.0.2 (latest) — 2024-01-21
- 0.0.1-1 — 2023-09-24
- 0.0.1-0 — 2023-09-24

## README

# Cryptic Storage

### Browser & Server compatible encrypted storage

Cryptic is a thin wrapper around Web Crypto and sets sane defaults to allow quickly implementing encryption in your application.

### Getting Started
Install `crypticstorage` via NPM

```sh
npm install crypticstorage
```

### Example

```js
// Simple example

// import '../node_modules/crypticstorage/cryptic.js';
import { Cryptic } from 'crypticstorage';

const salt = Cryptic.bufferToHex(Cryptic.randomBytes(32))
const iv = Cryptic.bufferToHex(Cryptic.randomBytes(16))

const cryptic = Cryptic.create(
  decryptPass,
  salt,
)

let encryptedText = await cryptic.encrypt(
  'text to encrypt',
  iv,
);

console.log('Encrypted Text', encryptedText)

let decryptedText = await cryptic.decrypt(
  encryptedText,
  iv,
);

console.log('Decrypted Text', decryptedText)
```

## Breaking Changes

**Deprecation warning**: `Cryptic.encryptString` renamed to `Cryptic.create`

**Breaking Change**: `Cryptic.encryptString` now expects `salt` in HEX format instead of a string. If stored as plain string, convert with the example below.

```js
const cryptic = Cryptic.create(
  encryptPass,
  Cryptic.bufferToHex(
    Cryptic.stringToBuffer(salt)
  )
)
```

---
_Source: https://npm.io/package/crypticstorage · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
