# connect-crypto

> middlewares and other connect and crypto related odds and ends

Latest version **0.0.8** (published 2013-08-27) · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install connect-crypto
pnpm add connect-crypto
yarn add connect-crypto
bun add connect-crypto
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.0.8 |
| Published | 2013-08-27 |
| First published | 2013-03-09 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Yaniv Kessler |
| Maintainers | yaniv |
| Keywords | connect, crypto, middleware |

## Links

- npm: https://www.npmjs.com/package/connect-crypto
- Repository: https://github.com/kessler/connect-crypto
- Issues: https://github.com/kessler/connect-crypto/issues
- npm.io page: https://npm.io/package/connect-crypto

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.0.8 (latest) — 2013-08-27
- 0.0.7 — 2013-07-25
- 0.0.6 — 2013-06-21
- 0.0.5 — 2013-03-26
- 0.0.4 — 2013-03-09
- 0.0.2 — 2013-03-09

## README

connect crypto utils
====================


### Install ###

```
	npm install connect-crypto
```

### query decryptor ###

decrypt predefined url parameters and reassigns the decrypted value to request.query

```
var queryDecryptor = require('connect-crypto').queryDecryptor;

var mypassword = '123123Foo';

// the server
var server = connect()		
		.use(connect.query())		
		.use(queryDecryptor('p', mypassword)) // decrypt any url that has ?p=encryptedData (will turn to ?p=decryptedData)
		.listen(3000);	


// the server
var server = connect()		
		.use(connect.query())		
		.use(queryDecryptor(['p1', 'p2'], mypassword)) // several querystring params can be decrypted 
		.listen(3000);	
	
```

further customization can be achieved by supplying an options object:
```
var options = {
	algorithm: 				which algo is used for encyption/decryption, defaults to 'aes192'

	debug: 					debug mode will write errors from decipher.final() to console and alert if 
							query middleware isn't installed

	decryptedDataEncoding:	encoding used to output decrypted data - must be the same encoding used in 
							the encyption process - defaults to 'ascii'

	encryptedDataEncoding: 	encoding used for encrypted data - defaults to 'base64'	
};

connect()
	.use(connect.query())		
	.use(queryDecryptor('p', mypassword, options));
```
when using the options object, one may specify only a subset of the above options

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