This repository has been archived by the owner on Jun 4, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Sefa Eyeoglu <[email protected]>
- Loading branch information
Showing
52 changed files
with
5,771 additions
and
1 deletion.
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,3 +1,2 @@ | ||
*.css.map | ||
/vendor/ | ||
.idea |
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,10 @@ | ||
<?php | ||
|
||
// autoload_files.php @generated by Composer | ||
|
||
$vendorDir = dirname(dirname(__FILE__)); | ||
$baseDir = dirname($vendorDir); | ||
|
||
return array( | ||
'5255c38a0faeba867671b61dfda6d864' => $vendorDir . '/paragonie/random_compat/lib/random.php', | ||
); |
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,11 @@ | ||
*~ | ||
/test/unit/File/big-generated-file | ||
/composer.lock | ||
/vendor | ||
defuse-crypto.phar | ||
defuse-crypto.phar.sig | ||
composer.phar | ||
box.phar | ||
phpunit.phar | ||
phpunit.phar.asc | ||
test/unit/File/tmp |
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,60 @@ | ||
<?php | ||
|
||
$config = Symfony\CS\Config\Config::create() | ||
->level(Symfony\CS\FixerInterface::PSR2_LEVEL) | ||
->fixers([ | ||
'blankline_after_open_tag', | ||
'empty_return', | ||
'extra_empty_lines', | ||
'function_typehint_space', | ||
'join_function', | ||
'method_argument_default_value', | ||
'multiline_array_trailing_comma', | ||
'no_blank_lines_after_class_opening', | ||
'no_empty_lines_after_phpdocs', | ||
'phpdoc_indent', | ||
'phpdoc_no_access', | ||
'phpdoc_no_empty_return', | ||
'phpdoc_no_package', | ||
'phpdoc_params', | ||
'phpdoc_scalar', | ||
'phpdoc_separation', | ||
'phpdoc_trim', | ||
'phpdoc_type_to_var', | ||
'phpdoc_types', | ||
'phpdoc_var_without_name', | ||
'remove_leading_slash_use', | ||
'remove_lines_between_uses', | ||
'short_bool_cast', | ||
'single_quote', | ||
'spaces_after_semicolon', | ||
'spaces_before_semicolon', | ||
'spaces_cast', | ||
'standardize_not_equal', | ||
'ternary_spaces', | ||
'trim_array_spaces', | ||
'unneeded_control_parentheses', | ||
'unused_use', | ||
'whitespacy_lines', | ||
'align_double_arrow', | ||
'concat_with_spaces', | ||
'logical_not_operators_with_successor_space', | ||
'multiline_spaces_before_semicolon', | ||
'newline_after_open_tag', | ||
'ordered_use', | ||
'php_unit_construct', | ||
'phpdoc_order', | ||
'short_array_syntax', | ||
]); | ||
|
||
if (null === $input->getArgument('path')) { | ||
$config | ||
->finder( | ||
Symfony\CS\Finder\DefaultFinder::create() | ||
->in('src') | ||
->in('test') | ||
->exclude('vendor') | ||
); | ||
} | ||
|
||
return $config; |
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 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2016 Taylor Hornby <https://defuse.ca> and Paragon Initiative | ||
Enterprises <https://paragonie.com>. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of | ||
this software and associated documentation files (the "Software"), to deal in | ||
the Software without restriction, including without limitation the rights to | ||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | ||
the Software, and to permit persons to whom the Software is furnished to do so, | ||
subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS | ||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR | ||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER | ||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
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,87 @@ | ||
php-encryption | ||
=============== | ||
|
||
[![Build Status](https://travis-ci.org/defuse/php-encryption.svg?branch=master)](https://travis-ci.org/defuse/php-encryption) | ||
|
||
This is a library for encrypting data with a key or password in PHP. **It | ||
requires PHP 5.4 or newer.** The current version is v2.0.0, which is expected to | ||
remain stable and supported by its authors with security and bugfixes until at | ||
least January 1st, 2019. | ||
|
||
The library is a joint effort between [Taylor Hornby](https://defuse.ca/) and | ||
[Scott Arciszewski](https://paragonie.com/blog/author/scott-arcizewski) as well | ||
as numerous open-source contributors. | ||
|
||
What separates this library from other PHP encryption libraries is, firstly, | ||
that it is secure. The authors used to encounter insecure PHP encryption code on | ||
a daily basis, so they created this library to bring more security to the | ||
ecosystem. Secondly, this library is "difficult to misuse." Like | ||
[libsodium](https://github.com/jedisct1/libsodium), its API is designed to be | ||
easy to use in a secure way and hard to use in an insecure way. | ||
|
||
Dependencies | ||
------------ | ||
|
||
This library requres no special dependencies except for PHP 5.4 or newer with | ||
the OpenSSL extensions enabled (this is the default). It uses | ||
[random\_compat](https://github.com/paragonie/random_compat), which is bundled | ||
in with this library so that your users will not need to follow any special | ||
installation steps. | ||
|
||
Getting Started | ||
---------------- | ||
|
||
Start with the [**Tutorial**](docs/Tutorial.md). You can find instructions for | ||
obtaining this library's code securely in the [Installing and | ||
Verifying](docs/InstallingAndVerifying.md) documentation. | ||
|
||
After you've read the tutorial and got the code, refer to the formal | ||
documentation for each of the classes this library provides: | ||
|
||
- [Crypto](docs/classes/Crypto.md) | ||
- [File](docs/classes/File.md) | ||
- [Key](docs/classes/Key.md) | ||
- [KeyProtectedByPassword](docs/classes/KeyProtectedByPassword.md) | ||
|
||
If you encounter difficulties, see the [FAQ](docs/FAQ.md) answers. The fixes to | ||
the most commonly-reported problems are explained there. | ||
|
||
If you're a cryptographer and want to understand the nitty-gritty details of how | ||
this library works, look at the [Cryptography Details](docs/CryptoDetails.md) | ||
documentation. | ||
|
||
If you're interested in contributing to this library, see the [Internal | ||
Developer Documentation](docs/InternalDeveloperDocs.md). | ||
|
||
Examples | ||
--------- | ||
|
||
If the documentation is not enough for you to understand how to use this | ||
library, then you can look at an example project that uses this library: | ||
|
||
- [encutil](https://github.com/defuse/encutil) | ||
|
||
Security Audit Status | ||
--------------------- | ||
|
||
This code has not been subjected to a formal, paid, security audit. However, it | ||
has received lots of review from members of the PHP security community, and the | ||
authors are experienced with cryptography. In all likelihood, you are safer | ||
using this library than almost any other encryption library for PHP. | ||
|
||
If you use this library as a part of your business and would like to help fund | ||
a formal audit, please [contact Taylor Hornby](https://defuse.ca/contact.htm). | ||
|
||
Public Keys | ||
------------ | ||
|
||
The GnuPG public key used to sign releases is available in | ||
[dist/signingkey.asc](https://github.com/defuse/php-encryption/raw/master/dist/signingkey.asc). Its fingerprint is: | ||
|
||
``` | ||
2FA6 1D8D 99B9 2658 6BAC 3D53 385E E055 A129 1538 | ||
``` | ||
|
||
You can verify it against the Taylor Hornby's [contact | ||
page](https://defuse.ca/contact.htm) and | ||
[twitter](https://twitter.com/DefuseSec/status/723741424253059074). |
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,30 @@ | ||
{ | ||
"name": "defuse/php-encryption", | ||
"description": "Secure PHP Encryption Library", | ||
"license": "MIT", | ||
"version": "2.0.3", | ||
"keywords": ["security", "encryption", "AES", "openssl", "cipher", "cryptography", "symmetric key cryptography", "crypto", "encrypt", "authenticated encryption"], | ||
"authors": [ | ||
{ | ||
"name": "Taylor Hornby", | ||
"email": "[email protected]", | ||
"homepage": "https://defuse.ca/" | ||
}, | ||
{ | ||
"name": "Scott Arciszewski", | ||
"email": "[email protected]", | ||
"homepage": "https://paragonie.com" | ||
} | ||
], | ||
"autoload": { | ||
"classmap": ["src"] | ||
}, | ||
"require": { | ||
"paragonie/random_compat": "~2.0", | ||
"ext-openssl": "*", | ||
"php": ">=5.4.0" | ||
}, | ||
"require-dev": { | ||
"nikic/php-parser": "^2.0" | ||
} | ||
} |
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,37 @@ | ||
# This builds defuse-crypto.phar. To run this Makefile, `box` and `composer` | ||
# must be installed and in your $PATH. Run it from inside the dist/ directory. | ||
|
||
box := $(shell which box) | ||
composer := "composer" | ||
|
||
.PHONY: all | ||
all: build-phar | ||
|
||
.PHONY: sign-phar | ||
sign-phar: | ||
gpg -u 7B4B2D98 --armor --output defuse-crypto.phar.sig --detach-sig defuse-crypto.phar | ||
|
||
# ensure we run in clean tree. export git tree and run there. | ||
.PHONY: build-phar | ||
build-phar: | ||
@echo "Creating .phar from revision $(shell git rev-parse HEAD)." | ||
rm -rf worktree | ||
install -d worktree | ||
(cd $(CURDIR)/..; git archive HEAD) | tar -x -C worktree | ||
$(MAKE) -f $(CURDIR)/Makefile -C worktree defuse-crypto.phar | ||
mv worktree/*.phar . | ||
rm -rf worktree | ||
|
||
.PHONY: clean | ||
clean: | ||
rm -vf defuse-crypto.phar defuse-crypto.phar.sig | ||
|
||
# Inside workdir/: | ||
|
||
defuse-crypto.phar: dist/box.json composer.lock | ||
cp dist/box.json . | ||
php -d phar.readonly=0 $(box) build -c box.json -v | ||
|
||
composer.lock: | ||
$(composer) install --no-dev | ||
|
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,25 @@ | ||
{ | ||
"chmod": "0755", | ||
"finder": [ | ||
{ | ||
"in": "src", | ||
"name": "*.php" | ||
}, | ||
{ | ||
"in": "vendor/composer", | ||
"name": "*.php" | ||
}, | ||
{ | ||
"in": "vendor/paragonie", | ||
"name": "*.php", | ||
"exclude": "other" | ||
} | ||
], | ||
"compactors": [ | ||
"Herrera\\Box\\Compactor\\Php" | ||
], | ||
"main": "vendor/autoload.php", | ||
"output": "defuse-crypto.phar", | ||
"shebang": false, | ||
"stub": true | ||
} |
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,52 @@ | ||
-----BEGIN PGP PUBLIC KEY BLOCK----- | ||
Version: GnuPG v2 | ||
|
||
mQINBFarvO4BEACdQBaLt6SUBx1cB5liUu1qo+YwVLh9bxTregQtmEREMdTVqXYt | ||
e5b79uL4pQp2GlKHcEyRURS+6rIIruM0oh9ZYGTJYPAkCDzJxaU2awZeFbfBvpCm | ||
iF66/O4ZJI4mlT8dFKmxBJxDhfeOR2UmmhDiEsJK9FxBKUzvo/dW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