Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
sop committed Aug 3, 2017
1 parent 7d4d941 commit f77010e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
[![License](https://poser.pugx.org/sop/aes-kw/license)](https://github.com/sop/aes-kw/blob/master/LICENSE)

# AES Key Wrap

A PHP library for AES Key Wrap
([RFC 3394](https://tools.ietf.org/html/rfc3394))
algorithm with padding
Expand All @@ -13,15 +14,18 @@ support.
Supports AES key sizes of 128, 192 and 256 bits.

## Installation

This library is available on
[Packagist](https://packagist.org/packages/sop/aes-kw).

composer require sop/aes-kw

## Code examples

Here are some simple usage examples. Namespaces are omitted for brevity.

### Wrap a 128 bit key with AES-128

Wrap a key of 16 bytes using a 16-byte key encryption key.

```php
Expand All @@ -37,6 +41,7 @@ Outputs:
89efdbc3501f1f5e952a4bbae1329c9f1a47b9fd61b48dee

### Unwrap a key

Unwrap a key from previous example. `$kek` and `$algo` variables are the same.
`$ciphertext` variable contains the output from a wrapping procedure.

Expand All @@ -50,6 +55,7 @@ Outputs:
MySecretPassword

### Wrap an arbitrary length passphrase with AES-192

Wrapping a key that is not a multiple of 64 bits requires padding.

```php
Expand All @@ -65,6 +71,7 @@ Outputs:
f319811450badfe4385b5534bf26fa6f9fdcd1a593b3ae6b707f15c1015bbf3faf58619818bd8784

### Unwrap a key with padding

Key that was wrapped with padding must be unwrapped with `unwrapPad`.

```php
Expand All @@ -77,4 +84,5 @@ Outputs:
My hovercraft is full of eels.

## License

This project is licensed under the MIT License.

0 comments on commit f77010e

Please sign in to comment.