Skip to content

Commit 4db9dbe

Browse files
committed
Version 1.0.0
0 parents  commit 4db9dbe

15 files changed

+1769
-0
lines changed

.gitattributes

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/.gitattributes export-ignore
2+
/.gitignore export-ignore
3+
/.travis.yml export-ignore
4+
/.scrutinizer.yml export-ignore
5+
/phpspec.yml export-ignore
6+
/phpspec-ci.yml export-ignore
7+
/phpunit.xml export-ignore
8+
/phpunit.xml.dist export-ignore
9+
/tests export-ignore
10+
/spec export-ignore

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/vendor
2+
/.cache
3+
/coverage
4+
coverage.*
5+
composer.phar
6+
.idea
7+
.DS_Store
8+
Thumbs.db

.scrutinizer.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
filter:
2+
excluded_paths:
3+
- 'tests/*'
4+
- 'spec/*'
5+
6+
checks:
7+
php:
8+
code_rating: true
9+
duplication: true
10+
11+
coding_style:
12+
php:
13+
spaces:
14+
around_operators:
15+
negation: true
16+
17+
build:
18+
tests:
19+
override:
20+
-
21+
command: 'vendor/bin/phpspec run -f progress -c phpspec-ci.yml'
22+
coverage:
23+
file: 'coverage.clover'
24+
format: 'php-clover'

.travis.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
language: php
2+
3+
php:
4+
- 5.4
5+
- 5.5
6+
- 5.6
7+
- hhvm
8+
9+
before_script:
10+
- composer self-update
11+
- composer install --prefer-source --no-interaction --dev
12+
13+
script: vendor/bin/phpspec run

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changelog
2+
3+
All Notable changes to `Encrypter` will be documented in this file.
4+
5+
## 1.0.0 (2015-03-28)
6+
7+
- Version 1.0.0 of `Encrypter`
8+
- Includes an adapter for Laravel's `Encrypter`

LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# The MIT License (MIT)
2+
3+
Copyright (c) 2015 Ivan Vermeyen (<[email protected]>)
4+
5+
> Permission is hereby granted, free of charge, to any person obtaining a copy
6+
> of this software and associated documentation files (the "Software"), to deal
7+
> in the Software without restriction, including without limitation the rights
8+
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
> copies of the Software, and to permit persons to whom the Software is
10+
> furnished to do so, subject to the following conditions:
11+
>
12+
> The above copyright notice and this permission notice shall be included in
13+
> all copies or substantial portions of the Software.
14+
>
15+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
> THE SOFTWARE.

README.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Encrypter
2+
3+
[![GitHub release](https://img.shields.io/github/release/codezero-be/encrypter.svg)]()
4+
[![License](https://img.shields.io/packagist/l/codezero/encrypter.svg)]()
5+
[![Build Status](https://img.shields.io/travis/codezero-be/encrypter.svg?branch=master)](https://travis-ci.org/codezero-be/encrypter)
6+
[![Scrutinizer](https://img.shields.io/scrutinizer/g/codezero-be/encrypter.svg)](https://scrutinizer-ci.com/g/codezero-be/encrypter)
7+
[![Total Downloads](https://img.shields.io/packagist/dt/codezero/encrypter.svg)](https://packagist.org/packages/codezero/encrypter)
8+
9+
#### Encrypt and decrypt strings in PHP.
10+
11+
This package includes an adapter for [Laravel](http://laravel.com/)'s `Encrypter` that adheres to my `Encrypter` interface. This can be used in vanilla PHP. Other implementations might be added in the future.
12+
13+
## Installation
14+
15+
Install this package through Composer:
16+
17+
composer require codezero/encrypter
18+
19+
## Vanilla PHP Implementation
20+
21+
Autoload the vendor classes:
22+
23+
require_once 'vendor/autoload.php'; // Path may vary
24+
25+
Choose a key. You will need the same key that was used to encrypt a string, to decrypt it.
26+
27+
$key = 'my secret key';
28+
29+
And then use the `DefaultEncrypter` implementation:
30+
31+
$encrypter = new \CodeZero\Encrypter\DefaultEncrypter($key);
32+
33+
## Usage
34+
35+
### Encrypt a string
36+
37+
$encrypted = $encrypter->encrypt('some string');
38+
39+
### Decrypt an encrypted string
40+
41+
try {
42+
$decrypted = $encrypter->decrypt($encrypted);
43+
} catch (\CodeZero\Encrypter\DecryptException $exception) {
44+
// Decryption failed...
45+
}
46+
## Testing
47+
48+
$ vendor/bin/phpspec run
49+
50+
## Security
51+
52+
If you discover any security related issues, please [e-mail me](mailto:[email protected]) instead of using the issue tracker.
53+
54+
## License
55+
56+
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
57+
58+
---
59+
[![Analytics](https://ga-beacon.appspot.com/UA-58876018-1/codezero-be/encrypter)](https://github.com/igrigorik/ga-beacon)

composer.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"name": "codezero/encrypter",
3+
"description": "Encrypt and decrypt strings in PHP.",
4+
"keywords": [
5+
"encryption",
6+
"encrypt",
7+
"php",
8+
"laravel"
9+
],
10+
"license": "MIT",
11+
"authors": [
12+
{
13+
"name": "Ivan Vermeyen",
14+
"email": "[email protected]"
15+
}
16+
],
17+
"require": {
18+
"php": ">=5.4.0",
19+
"illuminate/contracts": "~5.0",
20+
"illuminate/encryption": "~5.0"
21+
},
22+
"require-dev": {
23+
"phpspec/phpspec": "~2.0",
24+
"henrikbjorn/phpspec-code-coverage": "~1.0"
25+
},
26+
"autoload": {
27+
"psr-4": {
28+
"CodeZero\\Encrypter\\": "src/"
29+
}
30+
},
31+
"minimum-stability": "stable"
32+
}

0 commit comments

Comments
 (0)