-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from martinusso/opencrypt
rename project to opencrypt
- Loading branch information
Showing
7 changed files
with
42 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,32 @@ | ||
# simplecrypt | ||
# opencrypt | ||
|
||
[![Build Status](https://travis-ci.org/martinusso/simplecrypt.svg?branch=master)](https://travis-ci.org/martinusso/simplecrypt) | ||
[![Build Status](https://scrutinizer-ci.com/g/martinusso/simplecrypt/badges/build.png?b=master)](https://scrutinizer-ci.com/g/martinusso/simplecrypt/build-status/master) | ||
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/martinusso/simplecrypt/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/martinusso/simplecrypt/?branch=master) | ||
[![Code Coverage](https://scrutinizer-ci.com/g/martinusso/simplecrypt/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/martinusso/simplecrypt/?branch=master) | ||
[![Build Status](https://travis-ci.org/martinusso/opencrypt.svg?branch=master)](https://travis-ci.org/martinusso/opencrypt) | ||
[![Build Status](https://scrutinizer-ci.com/g/martinusso/opencrypt/badges/build.png?b=master)](https://scrutinizer-ci.com/g/martinusso/opencrypt/build-status/master) | ||
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/martinusso/opencrypt/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/martinusso/opencrypt/?branch=master) | ||
[![Code Coverage](https://scrutinizer-ci.com/g/martinusso/opencrypt/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/martinusso/opencrypt/?branch=master) | ||
|
||
Encrypts and decrypts data using PHP with OpenSSL | ||
|
||
## Installation | ||
|
||
`composer require martinusso/simplecrypt` | ||
`composer require martinusso/opencrypt` | ||
|
||
## Usage | ||
|
||
``` | ||
$password = "simplecrypt"; | ||
$password = "OpenCrypt"; | ||
$secretKey = 'SECRET_KEY'; | ||
$secretIV = 'SECRET_IV'; | ||
$simpleCrypt = new SimpleCrypt($secretKey, $secretIV); | ||
$openCrypt = new OpenCrypt($secretKey, $secretIV); | ||
$encryptedPassword = $simpleCrypt->encrypt($password); | ||
// $encryptedPassword = 'VGU4aUJiM1dZWmhHaDNGUUlnd05vUT09' | ||
$decryptedPassword = $simpleCrypt->decrypt($encryptedPassword); | ||
// $decryptedPassword = 'simplecrypt' | ||
$encryptedPassword = $openCrypt->encrypt($password); | ||
// $encryptedPassword = 'RTZPSEUybDZLZy9lSzYwaHk1Y0gxZz09' | ||
$decryptedPassword = $openCrypt->decrypt($encryptedPassword); | ||
// $decryptedPassword = 'OpenCrypt' | ||
``` | ||
|
||
## License | ||
|
||
This software is open source, licensed under the The MIT License (MIT). See [LICENSE](https://github.com/martinusso/simplecrypt/blob/master/LICENSE) for details. | ||
This software is open source, licensed under the The MIT License (MIT). See [LICENSE](https://github.com/martinusso/opencrypt/blob/master/LICENSE) for details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
namespace OpenCrypt\Tests; | ||
|
||
use OpenCrypt\OpenCrypt; | ||
|
||
final class OpenCryptTest extends \PHPUnit\Framework\TestCase | ||
{ | ||
public function testCrypt() | ||
{ | ||
$password = "OpenCrypt"; | ||
|
||
$openCrypt = new OpenCrypt('1', '2'); | ||
|
||
$encryptedPassword = $openCrypt->encrypt($password); | ||
$this->assertEquals('RTZPSEUybDZLZy9lSzYwaHk1Y0gxZz09', $encryptedPassword); | ||
|
||
$decryptedPassword = $openCrypt->decrypt($encryptedPassword); | ||
$this->assertEquals($password, $decryptedPassword); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.