Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encryption and decryption, exmples, and tests #2

Open
wants to merge 204 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
204 commits
Select commit Hold shift + click to select a range
6e8dc47
Constructor for OpenPGP_LiteralDataPacket
singpolyma Mar 31, 2010
6ac274b
Implement OpenPGP_SecretKeyPacket
singpolyma Mar 31, 2010
36fba15
Default packet constructor can take data
singpolyma Apr 1, 2010
5829037
SignatureSubpacket constructor (for tag/type)
singpolyma Apr 1, 2010
eb7aaf4
Ensure 2 hex digits per byte
singpolyma Apr 1, 2010
fe7121e
Method for LiteralData normalization
singpolyma Apr 1, 2010
e3bc375
Normalize before verifying
singpolyma Apr 1, 2010
1c7f759
There may be no subpackets
singpolyma Apr 1, 2010
1e2db5b
This is the correct size
singpolyma Apr 1, 2010
ec4b5c5
Generate SignaturePacket trailer
singpolyma Apr 1, 2010
86c4768
Contructor for OpenPGP_SignaturePacket
singpolyma Apr 1, 2010
0b2942e
SignaturePacket method to do actual signing
singpolyma Apr 1, 2010
191aeaa
fingerprint works on secret key too
singpolyma Apr 1, 2010
6dc7c1e
Abstract extracting a signature packet along with data
singpolyma Apr 1, 2010
1e81ed0
Wrapper to use OpenPGP with Crypt_RSA
singpolyma Apr 1, 2010
b42ec74
Conveniance function to get issuer
singpolyma Apr 1, 2010
e931ebe
Changes to allow using a set of keys (ie, key with subkeys)
singpolyma Apr 1, 2010
417c206
Implement OpenPGP_SignaturePacket_EmbeddedSignaturePacket
singpolyma Apr 1, 2010
39e1d5c
Conveniance function to get self signatures
singpolyma Apr 1, 2010
99debc4
Implement OpenPGP_SignaturePacket_SignatureExpirationTimePacket
singpolyma Apr 1, 2010
9cdc250
Implement OpenPGP_SignaturePacket_KeyExpirationTimePacket
singpolyma Apr 1, 2010
5756085
Convenience function for expiry time of keys
singpolyma Apr 1, 2010
377a86a
Added feature to the README
singpolyma Apr 1, 2010
66ab5cc
Fingerprint calculation works on secret keys now
singpolyma Jun 28, 2010
6cbd7f6
Check the actual format
singpolyma Jun 28, 2010
1f04075
Example code on using the library
singpolyma Apr 23, 2011
6b84457
Newline before crc24 on enarmor
singpolyma Apr 28, 2011
af3643c
crc24 was not encoded
singpolyma Apr 28, 2011
951ff2c
use bitlength
singpolyma Jul 25, 2011
1322f45
revert broken example script
singpolyma Jul 25, 2011
82fb19c
Implement KeyFlagsPacket
singpolyma Jul 25, 2011
dab71c1
Implement FeaturesPacket
singpolyma Jul 25, 2011
0f5742b
Implement output body for PublicKeyPacket
singpolyma Jul 25, 2011
69ade89
refactor SecretKeyPacket read
singpolyma Jul 25, 2011
c2c934f
Implement SecretKeyPacket output body
singpolyma Jul 25, 2011
6bf8e8c
UserIDPacket body
singpolyma Jul 25, 2011
4dbfbcb
Working constructor for PublicKey
singpolyma Jul 25, 2011
fb9fddd
Working constructor for UserID
singpolyma Jul 25, 2011
b84a2a8
Allow using keys as data to sign over
singpolyma Jul 25, 2011
379c79d
Crypt_RSA wrapper for signing keys
singpolyma Jul 25, 2011
ae7454c
Example code for generating a self-signed key
singpolyma Jul 25, 2011
5cba4f2
Import Serialization tests from OpenPGP-Haskell
singpolyma Jan 20, 2013
057c794
poke travis
singpolyma Jan 20, 2013
c5600d2
Enable meat of tests, all but one pass
singpolyma Jan 20, 2013
825452e
Support v3 sigs and keys properly
singpolyma Jan 20, 2013
f4af8a0
Remove unsafe use of array_pop
singpolyma Jan 20, 2013
995a9d7
Fingerprint tests
singpolyma Jan 20, 2013
7d44211
Clarify the verify example
singpolyma Jan 20, 2013
2258534
Message signature verification tests
singpolyma Jan 21, 2013
8d19f70
dependencies for travis
singpolyma Jan 21, 2013
f9ea5ee
Try without pear
singpolyma Jan 21, 2013
4263d03
Restructure signing code
singpolyma Jan 21, 2013
7a1510f
Remove unsafe uses of reset
singpolyma Jan 21, 2013
74afee6
Test signing at all
singpolyma Jan 21, 2013
dffa0ec
Generalize S2K support, and support SymmetricSessionKeyPacket
singpolyma Jan 21, 2013
68b2047
Both kinds of EncryptedDataPacket
singpolyma Jan 21, 2013
06cf887
Forgot these data files
singpolyma Jan 21, 2013
bf8201f
Start work on decryption
singpolyma Jan 21, 2013
567b18c
Support 3DES
singpolyma Jan 26, 2013
47a7f6e
Keep trying on failure
singpolyma Jan 26, 2013
8c60f4e
Support the no-MDC (resync) case
singpolyma Jan 26, 2013
641c078
Support session keys
singpolyma Jan 26, 2013
cd15aec
Asymmetric decryption
singpolyma Jan 26, 2013
ae06243
Fix for PHP 5.3 grammar
singpolyma Jan 26, 2013
a567999
Decrypt secret key
singpolyma Jan 26, 2013
7d776fd
Encryption support
singpolyma Jan 26, 2013
cb9f918
encrypt/decrypt example
singpolyma Jan 26, 2013
2a331f7
better random string
singpolyma Jan 26, 2013
216ee41
Add features to README
singpolyma Jan 26, 2013
aab2a5e
Data representation bugs in signature subpackets
singpolyma Feb 18, 2013
778c83d
Better pubring.gpg
singpolyma Feb 18, 2013
1ecb990
Use key_from_input as originally intended
singpolyma Feb 24, 2013
04b89de
Should not throw away the version
singpolyma Feb 24, 2013
3afd401
Whitespace and proper padAmount
singpolyma Feb 24, 2013
05b757a
No index anymore
singpolyma Feb 24, 2013
58d1b5c
Clean up encryptDecrypt example
singpolyma Jun 24, 2013
c341d7f
Fix byte encoding of some packets
singpolyma Jun 24, 2013
26860d3
Always an MPI for RSA
singpolyma Jun 24, 2013
e27f9e2
Full example of decrypting a message
singpolyma Jun 24, 2013
e784241
Any secret key
singpolyma Jun 24, 2013
7ae4d53
Better errors for unsupported ciphers.
singpolyma Sep 14, 2013
82ed7d8
Rename symmetric encrypt/decrypt class
singpolyma Sep 14, 2013
6075d05
Use require_once in examples.
singpolyma Sep 14, 2013
e1181bd
Support for AES and 3DES are now optional
singpolyma Sep 14, 2013
d2913cc
Add support for CAST5 using mcrypt
singpolyma Sep 14, 2013
775aa96
Remove debug code
singpolyma Jun 28, 2014
0262b03
Fix sign_key_userid
singpolyma Jun 28, 2014
d6568d4
Initial doxygen setup
singpolyma Jun 28, 2014
68514c1
Add simple composer.json
vstm Mar 14, 2015
ae21dd0
Make autoload work for phpunit tests
vstm Mar 14, 2015
6287ba8
Make use of the classmap, the current class/file structure does not a…
vstm Mar 14, 2015
ec8df93
Don't make a scene if there is no autoload.php (if someone isn't usin…
vstm Mar 14, 2015
3835a48
Not needed at this point
vstm Mar 14, 2015
2fb1666
Use composer to load dependencies
vstm Mar 14, 2015
9d6d736
Add newline before end-of-file (PSR-2)
vstm Mar 15, 2015
4756c82
Merge pull request #4 from vstm/composer-simple
singpolyma Mar 16, 2015
cb4fe9c
Changed require Crypt/RSA.php to require_once
hoffstadt Jun 18, 2015
055b5c5
Add clearsign example
singpolyma Jul 4, 2015
5291a06
Merge pull request #7 from Hoffstadt/patch-1
singpolyma Jul 6, 2015
9bffda3
Update openpgp_crypt_rsa.php
adecaneda Jul 31, 2015
4fe3c5d
Merge pull request #8 from adecaneda/adecaneda-patch-1
singpolyma Aug 1, 2015
01a1f00
Inclued partial body lengths
adecaneda Aug 5, 2015
4281c8f
Missing parameter
adecaneda Aug 5, 2015
cc52cb9
Missing parameter in parse_old_format
adecaneda Aug 5, 2015
f4fabd0
Merge pull request #9 from adecaneda/Partial-body-lengths
singpolyma Aug 14, 2015
d37e91e
Example to serialize public key message
singpolyma Nov 16, 2015
ff4bd67
use phpseclib 2.0
Nov 20, 2015
a1fe3a6
Merge pull request #16 from sivig/phpseclib-2
singpolyma Nov 30, 2015
b260774
Link to new project that uses OpenPGP.php as library.
fabacab Feb 21, 2016
57ab281
Merge pull request #22 from meitar/new-consumer
singpolyma Feb 21, 2016
bcc9c92
fixed keygen example for the phpseclib 2.0 branch
DanielRuf Feb 23, 2016
6340379
Merge pull request #24 from DanielRuf/patch-1
singpolyma Feb 24, 2016
cefaef2
Update normalise and example for clearsigning
singpolyma Feb 24, 2016
08ae2c5
use $cipher->key_length
DanielRuf Mar 14, 2016
a87e6ac
added more PHP versions to the travis file
DanielRuf Mar 15, 2016
15baf1d
Merge pull request #29 from DanielRuf/patch-3
singpolyma Mar 15, 2016
859efcb
Merge pull request #28 from DanielRuf/patch-2
singpolyma Mar 15, 2016
de41f14
Throw exception if using CAST5 without mcrypt
singpolyma Jul 26, 2016
6d9ed34
Less strict phpseclib requirement
singpolyma Jul 26, 2016
02fbcbf
nightly not working, can't find docs on the deprecation yet
singpolyma Jul 26, 2016
46ec507
Only env can matrix
singpolyma Jul 27, 2016
4531815
The code in fact expects an array of OR'd bytes
singpolyma Jul 27, 2016
741fec2
These coefficients go in the other order
singpolyma Jul 27, 2016
7538c62
Seems phpseclib 2.0.3 breaks us
singpolyma Apr 8, 2017
a61fb27
Merge pull request #45 from singpolyma/new-phpseclib-breaks-us
singpolyma Apr 8, 2017
cea5b17
https://github.com/phpseclib/phpseclib/issues/1113
jasekiw Apr 11, 2017
2561004
Merge pull request #46 from jasekiw/master
singpolyma Apr 11, 2017
6006111
Bump version number
singpolyma Apr 12, 2017
95facfb
Travis wants trusty for HHVM now
singpolyma Jul 19, 2017
c9ae825
New list of supported PHPs on Travis
singpolyma Jul 19, 2017
a8e7690
change links to https
Rotzbua Dec 15, 2017
5413285
Merge pull request #60 from Rotzbua/patch-1
singpolyma Dec 15, 2017
69d9354
add php 7.1 7.2
Rotzbua Dec 15, 2017
e8a5624
Update .travis.yml
Rotzbua Dec 15, 2017
f42afa0
Update .travis.yml
Rotzbua Dec 15, 2017
ebce9c0
add travis build status to reamde
Rotzbua Dec 15, 2017
ba3c3fd
add suggestion to composer
Rotzbua Dec 26, 2017
facaaa4
Merge pull request #63 from Rotzbua/Rotzbua-patch-1
singpolyma Dec 26, 2017
a9fc3f9
Merge pull request #64 from Rotzbua/Rotzbua-patch-2
singpolyma Jul 25, 2018
413741f
Throw more helpful exception when already decrypted
singpolyma Jul 25, 2018
498e606
If session decryption fails, return NULL
singpolyma Jul 25, 2018
26560f7
Upgrade phpunit version to use in Travis
singpolyma Jul 25, 2018
724d5b1
Newer phpunit can't support older PHP
singpolyma Jul 25, 2018
d756110
Test support for all newer versions of phpseclib
singpolyma Jul 25, 2018
5a6b605
Support Twofish and Blowfish
singpolyma Jul 25, 2018
43497a1
Use OpenSSL for CAST5
singpolyma Jul 25, 2018
44e1bb2
Do not throw when CAST5 unsupported
singpolyma Jul 25, 2018
f2e1710
Tell composer what versions of PHP we test against
singpolyma Jul 25, 2018
cba1ecc
Do not rely on asserts for behaviour
singpolyma Jul 25, 2018
aeb919a
Whitespace
singpolyma Jul 25, 2018
575baaf
Set up Travis to check combinations that all work
singpolyma Jul 25, 2018
752d80f
S2K salt is *always* 8 bytes
singpolyma Jul 25, 2018
34ffc76
Merge pull request #62 from Rotzbua/patch-2
singpolyma Jul 26, 2018
cd33ba1
Upstream isn't coming back
singpolyma Jul 26, 2018
f43fbdc
Put version into code
singpolyma Jul 26, 2018
fb671e1
Wordwrap enarmor output
singpolyma Nov 21, 2018
f8e0e99
Provide more guidance for understanding examples, update `.travis.yml`.
fabacab Dec 20, 2018
5e6a097
Merge pull request #76 from meitar/docs
singpolyma Mar 29, 2019
c0e6aeb
Remove support for hhvm
singpolyma May 1, 2019
67aba78
Bump to 0.4.0
singpolyma Aug 1, 2019
d27d30a
Implement encryptSecretKey
singpolyma Sep 11, 2019
8ab0a21
Merge branch 'encryptSecretKey'
singpolyma Sep 14, 2019
c9cef8e
Remove deprecated curly braces
divine Jan 10, 2020
eee624f
Add a keygen example with multiple UIDs and a separate encryption subkey
jstanden Feb 13, 2020
735721b
Fix checking when no bytes are available for reading
ottoszika May 7, 2020
573c336
Use Dhall to build the increasingly large test matrix
singpolyma Jun 19, 2020
a7f8aff
Merge branch 'fix-newer-php'
singpolyma Jun 19, 2020
d73ca16
Add funding file
singpolyma Nov 5, 2020
00e1d1a
Merge pull request #94 from jstanden/example-keygen-subkeys
singpolyma Nov 11, 2020
efa964b
Add signature test suite
ottoszika May 7, 2020
871d38d
Merge branch 'fix-read-byte'
singpolyma Nov 11, 2020
fd42c9f
Added 8.0 to the supported PHP versions in `composer.json`.
jstanden Dec 22, 2020
93b8db8
Updated tests to PHPUnit 9.x
jstanden Dec 22, 2020
6dfe2cd
Updated the TravisCI matrix to test PHP versions 7.3, 7.4, and 8.0.
jstanden Dec 29, 2020
fd5c3f0
Merge pull request #109 from jstanden/phpunit9
singpolyma Dec 30, 2020
a63e53d
Try to unarmor even with missing CRC
singpolyma Dec 30, 2020
618645f
Throw exception when decrypting unencrypted messages
singpolyma Dec 30, 2020
dfd0ce5
Add constructor to make working with CompressedDataPacket a bit easier
singpolyma Dec 30, 2020
c961eca
Add new example encrypt+sign+compress, armored input and output
singpolyma Dec 30, 2020
69292f6
Bump to 0.5.0
singpolyma May 26, 2021
0b53307
Avoid CVE-2021-30130.
Maikuolan Jun 16, 2021
3b62407
Add support for ECDH, ECDSA, and EdDSA keys
singpolyma Nov 17, 2021
ff3d98a
Allow a verifier that supports "all" hash functions
singpolyma Nov 17, 2021
fe63af6
Support for verifying Ed25519 signatures using Sodium
singpolyma Nov 17, 2021
0a92d91
Merge pull request #112 from Maikuolan/patch-1
singpolyma Nov 17, 2021
e1fdce4
Add Passbolt to the projects using the library
pabloelcolombiano Feb 14, 2022
9651038
Merge pull request #121 from passbolt/master
singpolyma Feb 14, 2022
d54fac4
Fix misc minor 8.1 compatibility issues
stripthis May 17, 2022
2a48242
Merge pull request #124 from stripthis/master
singpolyma May 23, 2022
872288a
Fix OpenPGP unarmor should return false if armor contain invalid Base…
stripthis Jul 29, 2022
969ef14
Merge branch 'master' of github.com:singpolyma/openpgp-php
stripthis Jul 29, 2022
8b08661
Move dependency phpseclib to v3
allan-simon Nov 18, 2021
03ad8a8
Update composer.json
allan-simon Jun 11, 2022
3a30e42
Merge pull request #126 from passbolt/master
singpolyma Oct 12, 2022
8dfac4b
Test armor and unarmor
singpolyma Oct 12, 2022
1c3bdcd
Bump to 0.6.0
singpolyma Oct 31, 2022
eb9f81e
Run travis on PHP 8.1, 8.2
ishanvyas22 Dec 5, 2022
f4dbc2f
Fix PHP 8.2 deprecation errors
ishanvyas22 Dec 5, 2022
9920173
Merge pull request #128 from ishanvyas22/php82
singpolyma Sep 4, 2023
92b56f3
PB-26152 parser support of critical subpacket flag
cedricalfonsi Feb 20, 2024
8dce47e
Fix hash_head
singpolyma Aug 12, 2024
ea85e2c
Merge pull request #135 from passbolt/feature/PB-26152_API-should-ide…
singpolyma Aug 12, 2024
3778c42
Fix typo
singpolyma Aug 12, 2024
b55996c
Bump to 0.7.0
singpolyma Aug 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
github: singpolyma
liberapay: singpolyma
patreon: singpolyma
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@
.tmp
pkg
tmp
composer.lock
.phpunit.result.cache
.idea
vendor/
32 changes: 32 additions & 0 deletions .travis.dhall
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
let Prelude = https://prelude.dhall-lang.org/v17.0.0/package.dhall
let phpseclib = \(max: Natural) -> \(filter: (Natural -> Bool)) ->
Prelude.List.map Natural Text
(\(m: Natural) -> "PHPSECLIB='2.0.${Prelude.Natural.show m}'")
(Prelude.List.filter Natural filter (Prelude.Natural.enumerate max))
let Exclusion = { php: Text, env: Text }
in
{
language = "php",
php = [
"7.3",
"7.4",
"8.0",
"8.1",
"8.2"
],
dist = "xenial",
env = [
"PHPSECLIB='^2.0 !=2.0.8'"
] # (phpseclib 28 (\(m: Natural) -> Prelude.Bool.not (Prelude.Natural.equal m 8))
),
matrix = {
exclude = Prelude.List.concatMap Text Exclusion (\(php: Text) ->
Prelude.List.map Text Exclusion (\(env: Text) ->
{ php = php, env = env }
) (phpseclib 7 (\(_: Natural) -> True))
) ["7.3", "7.4", "8.0", "8.1", "8.2"],
fast_finish = True
},
before_script = ''
sed -i "s/\"phpseclib\/phpseclib\": \"[^\"]*/\"phpseclib\/phpseclib\": \"$PHPSECLIB/" composer.json && composer install --prefer-source''
}
112 changes: 112 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
# Code generated by dhall-to-yaml. DO NOT EDIT.
before_script: "sed -i \"s/\\\"phpseclib\\/phpseclib\\\": \\\"[^\\\"]*/\\\"phpseclib\\/phpseclib\\\": \\\"$PHPSECLIB/\" composer.json && composer install --prefer-source"
dist: xenial
env:
- "PHPSECLIB='^2.0 !=2.0.8'"
- "PHPSECLIB='2.0.0'"
- "PHPSECLIB='2.0.1'"
- "PHPSECLIB='2.0.2'"
- "PHPSECLIB='2.0.3'"
- "PHPSECLIB='2.0.4'"
- "PHPSECLIB='2.0.5'"
- "PHPSECLIB='2.0.6'"
- "PHPSECLIB='2.0.7'"
- "PHPSECLIB='2.0.9'"
- "PHPSECLIB='2.0.10'"
- "PHPSECLIB='2.0.11'"
- "PHPSECLIB='2.0.12'"
- "PHPSECLIB='2.0.13'"
- "PHPSECLIB='2.0.14'"
- "PHPSECLIB='2.0.15'"
- "PHPSECLIB='2.0.16'"
- "PHPSECLIB='2.0.17'"
- "PHPSECLIB='2.0.18'"
- "PHPSECLIB='2.0.19'"
- "PHPSECLIB='2.0.20'"
- "PHPSECLIB='2.0.21'"
- "PHPSECLIB='2.0.22'"
- "PHPSECLIB='2.0.23'"
- "PHPSECLIB='2.0.24'"
- "PHPSECLIB='2.0.25'"
- "PHPSECLIB='2.0.26'"
- "PHPSECLIB='2.0.27'"
language: php
matrix:
exclude:
- env: "PHPSECLIB='2.0.0'"
php: '7.3'
- env: "PHPSECLIB='2.0.1'"
php: '7.3'
- env: "PHPSECLIB='2.0.2'"
php: '7.3'
- env: "PHPSECLIB='2.0.3'"
php: '7.3'
- env: "PHPSECLIB='2.0.4'"
php: '7.3'
- env: "PHPSECLIB='2.0.5'"
php: '7.3'
- env: "PHPSECLIB='2.0.6'"
php: '7.3'
- env: "PHPSECLIB='2.0.0'"
php: '7.4'
- env: "PHPSECLIB='2.0.1'"
php: '7.4'
- env: "PHPSECLIB='2.0.2'"
php: '7.4'
- env: "PHPSECLIB='2.0.3'"
php: '7.4'
- env: "PHPSECLIB='2.0.4'"
php: '7.4'
- env: "PHPSECLIB='2.0.5'"
php: '7.4'
- env: "PHPSECLIB='2.0.6'"
php: '7.4'
- env: "PHPSECLIB='2.0.0'"
php: '8.0'
- env: "PHPSECLIB='2.0.1'"
php: '8.0'
- env: "PHPSECLIB='2.0.2'"
php: '8.0'
- env: "PHPSECLIB='2.0.3'"
php: '8.0'
- env: "PHPSECLIB='2.0.4'"
php: '8.0'
- env: "PHPSECLIB='2.0.5'"
php: '8.0'
- env: "PHPSECLIB='2.0.6'"
php: '8.0'
- env: "PHPSECLIB='2.0.0'"
php: '8.1'
- env: "PHPSECLIB='2.0.1'"
php: '8.1'
- env: "PHPSECLIB='2.0.2'"
php: '8.1'
- env: "PHPSECLIB='2.0.3'"
php: '8.1'
- env: "PHPSECLIB='2.0.4'"
php: '8.1'
- env: "PHPSECLIB='2.0.5'"
php: '8.1'
- env: "PHPSECLIB='2.0.6'"
php: '8.1'
- env: "PHPSECLIB='2.0.0'"
php: '8.2'
- env: "PHPSECLIB='2.0.1'"
php: '8.2'
- env: "PHPSECLIB='2.0.2'"
php: '8.2'
- env: "PHPSECLIB='2.0.3'"
php: '8.2'
- env: "PHPSECLIB='2.0.4'"
php: '8.2'
- env: "PHPSECLIB='2.0.5'"
php: '8.2'
- env: "PHPSECLIB='2.0.6'"
php: '8.2'
fast_finish: true
php:
- '7.3'
- '7.4'
- '8.0'
- '8.1'
- '8.2'
Loading