# @fnx-components/crypto

> A service library for encrypting and decrypting values in your angular project. This library was generated with [Angular CLI](https://github.com/angular/angular-cli)

Latest version **0.4.0** (published 2021-03-31) · 0 weekly downloads

## Install

```sh
npm install @fnx-components/crypto
pnpm add @fnx-components/crypto
yarn add @fnx-components/crypto
bun add @fnx-components/crypto
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.4.0 |
| Published | 2021-03-31 |
| First published | 2021-03-25 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 17.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | ricardorinco |

## Links

- npm: https://www.npmjs.com/package/@fnx-components/crypto
- npm.io page: https://npm.io/package/@fnx-components/crypto

## Dependencies (2)

- [tslib](https://npm.io/package/tslib.md) ^2.0.0
- [crypto-js](https://npm.io/package/crypto-js.md) ^4.0.0

## Recent versions

- 0.4.0 (latest) — 2021-03-31
- 0.3.0 — 2021-03-26
- 0.2.0 — 2021-03-25

## README

# FnxCrypto Service

A service library for encrypting and decrypting values in your angular project.
This library was generated with [Angular CLI](https://github.com/angular/angular-cli)

## Installing

In your Angular project run

```typescript
npm i --save @fnx-components/crypto
```

## Getting Started

After installing it you need to inject the FnxCryptoService in your controller

```typescript
import { FnxCryptoService } from '@fnx-components/crypto';

constructor(
    ...
    private readonly fnxCryptoService: FnxCryptoService
) { }
```

then you can start encrypting and decrypting your values

```typescript
// Your secret key
const secretKey = 'lANQBCf8TdBWhMHJm-IBlQ';

// Encrypt value
const encryptedValue = this.fnxCryptoService.encrypt(`Roads? Where We're Going We Don't Need Roads`, secretKey);

// Decrypted value
const encryptedValue = 'U2FsdGVkX1+HPC4KY6T9tY5dFnqc9sEVcuTXizTEfdZzdZsOq9d708EzDT0SDtepcExTy3N3BeBxaf8YpQe1Kw==';
const decryptedValue = this.fnxCryptoService.decrypt(encryptedValue, secretKey);
```

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