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

New algorithms #102

Merged
merged 27 commits into from
May 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
0835040
New Algorithms
Spomky Mar 9, 2018
68b2760
Apply fixes from StyleCI (#101)
Spomky Mar 9, 2018
f9910c7
Merge branch 'v1.1' into NewAlgorithms
Spomky Mar 14, 2018
354e73a
Apply fixes from StyleCI (#108)
Spomky Mar 14, 2018
2987bac
Symfony 3.4+ required
Spomky Mar 14, 2018
d8ccd5f
A192CTR Key Encryption Algorithm service added
Spomky Mar 14, 2018
b256376
Merge branch 'v1.1' into NewAlgorithms
Spomky Mar 19, 2018
c9621f0
Messages for new algorithms
Spomky Mar 19, 2018
de6d79f
Bug fixed
Spomky Mar 19, 2018
8c013c7
PHP7 Support badge remove
Spomky Mar 21, 2018
f37051f
Revert Yaml to PHP (#116)
Spomky Apr 3, 2018
b629def
Minor tests modifications
Spomky Apr 3, 2018
300b544
Jwt split (#118)
Spomky Apr 11, 2018
778255f
v1.2.0-dev branch
Spomky Apr 11, 2018
e7dbe10
Experimental branch created
Spomky Apr 11, 2018
9bb9b83
Some experimental algorithms added
Spomky May 15, 2018
54382ca
Keys in a key set is a list, not an object with indexes (#126)
Spomky May 29, 2018
1ccfbfe
Sub-packages for algorithms
Spomky May 29, 2018
282f9ca
Sub-packages for algorithms + gitsplit configuration
Spomky May 29, 2018
80d47ec
Sub-packages for algorithms + gitsplit configuration
Spomky May 29, 2018
31ec1c2
Bugs fixed
Spomky May 29, 2018
0930bab
Bugs fixed
Spomky May 29, 2018
3b95027
New Algorithms
Spomky Mar 9, 2018
446e802
Apply fixes from StyleCI (#108)
Spomky Mar 14, 2018
24c1e4f
Apply fixes from StyleCI (#127)
Spomky May 29, 2018
ba35c30
Bugs fixed
Spomky May 29, 2018
359bd95
Merge branch 'v1.2' into NewAlgorithms
Spomky May 29, 2018
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
76 changes: 76 additions & 0 deletions src/Bundle/JoseFramework/DataCollector/AlgorithmCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,82 @@ private function getAlgorithmMessages(): array
'severity' => 'severity-low',
'message' => 'This algorithm is not secured. Please use with caution.',
],
'HS256/64' => [
'severity' => 'severity-low',
'message' => 'Experimental. Please use for testing purpose only.',
],
'hs1' => [
'severity' => 'severity-high',
'message' => 'This algorithm has known vulnerabilities. See <a target="_blank" href="https://tools.ietf.org/html/draft-irtf-cfrg-webcrypto-algorithms-00#section-17">https://tools.ietf.org/html/draft-irtf-cfrg-webcrypto-algorithms-00#section-17</a>.',
],
'A128CTR' => [
'severity' => 'severity-high',
'message' => 'This algorithm is prohibited. For compatibility with old application only. See <a target="_blank" href="https://tools.ietf.org/html/draft-irtf-cfrg-webcrypto-algorithms-00#section-11">https://tools.ietf.org/html/draft-irtf-cfrg-webcrypto-algorithms-00#section-11</a>.',
],
'A192CTR' => [
'severity' => 'severity-high',
'message' => 'This algorithm is prohibited. For compatibility with old application only. See <a target="_blank" href="https://tools.ietf.org/html/draft-irtf-cfrg-webcrypto-algorithms-00#section-11">https://tools.ietf.org/html/draft-irtf-cfrg-webcrypto-algorithms-00#section-11</a>.',
],
'A256CTR' => [
'severity' => 'severity-high',
'message' => 'This algorithm is prohibited. For compatibility with old application only. See <a target="_blank" href="https://tools.ietf.org/html/draft-irtf-cfrg-webcrypto-algorithms-00#section-11">https://tools.ietf.org/html/draft-irtf-cfrg-webcrypto-algorithms-00#section-11</a>.',
],
'A128CBC' => [
'severity' => 'severity-high',
'message' => 'This algorithm is prohibited. For compatibility with old application only. See <a target="_blank" href="https://tools.ietf.org/html/draft-irtf-cfrg-webcrypto-algorithms-00#section-11">https://tools.ietf.org/html/draft-irtf-cfrg-webcrypto-algorithms-00#section-11</a>.',
],
'A192CBC' => [
'severity' => 'severity-high',
'message' => 'This algorithm is prohibited. For compatibility with old application only. See <a target="_blank" href="https://tools.ietf.org/html/draft-irtf-cfrg-webcrypto-algorithms-00#section-11">https://tools.ietf.org/html/draft-irtf-cfrg-webcrypto-algorithms-00#section-11</a>.',
],
'A256CBC' => [
'severity' => 'severity-high',
'message' => 'This algorithm is prohibited. For compatibility with old application only. See <a target="_blank" href="https://tools.ietf.org/html/draft-irtf-cfrg-webcrypto-algorithms-00#section-11">https://tools.ietf.org/html/draft-irtf-cfrg-webcrypto-algorithms-00#section-11</a>.',
],
'chacha20-poly1305' => [
'severity' => 'severity-low',
'message' => 'Experimental. Please use for testing purpose only.',
],
'RSA-OAEP-384' => [
'severity' => 'severity-low',
'message' => 'Experimental. Please use for testing purpose only.',
],
'RSA-OAEP-512' => [
'severity' => 'severity-low',
'message' => 'Experimental. Please use for testing purpose only.',
],
'AES-CCM-16-64-128' => [
'severity' => 'severity-low',
'message' => 'Experimental and subject to changes. Please use for testing purpose only.',
],
'AES-CCM-16-64-256' => [
'severity' => 'severity-low',
'message' => 'Experimental and subject to changes. Please use for testing purpose only.',
],
'AES-CCM-64-64-128' => [
'severity' => 'severity-low',
'message' => 'Experimental and subject to changes. Please use for testing purpose only.',
],
'AES-CCM-64-64-256' => [
'severity' => 'severity-low',
'message' => 'Experimental and subject to changes. Please use for testing purpose only.',
],
'AES-CCM-16-128-128' => [
'severity' => 'severity-low',
'message' => 'Experimental and subject to changes. Please use for testing purpose only.',
],
'AES-CCM-16-128-256' => [
'severity' => 'severity-low',
'message' => 'Experimental and subject to changes. Please use for testing purpose only.',
],
'AES-CCM-64-128-128' => [
'severity' => 'severity-low',
'message' => 'Experimental and subject to changes. Please use for testing purpose only.',
],
'AES-CCM-64-128-256' => [
'severity' => 'severity-low',
'message' => 'Experimental and subject to changes. Please use for testing purpose only.',
],
'RSA1_5' => [
'severity' => 'severity-high',
'message' => 'This algorithm is not secured (known attacks). See <a target="_blank" href="https://tools.ietf.org/html/draft-irtf-cfrg-webcrypto-algorithms-00#section-5">https://tools.ietf.org/html/draft-irtf-cfrg-webcrypto-algorithms-00#section-5</a>.',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,56 @@ services:
Jose\Component\Encryption\Algorithm\KeyEncryption\RSAOAEP256:
tags:
- {'name': 'jose.algorithm', 'alias': 'RSA-OAEP-256'}

# ---- New algorithms ----
# These algorithms are out of the main specifications but referenced in
# some WebAuthn documents.
#
# They may be subject to changes.
# ------------------------

Jose\Component\Encryption\Algorithm\KeyEncryption\Chacha20Poly1305:
tags:
- {'name': 'jose.algorithm', 'alias': 'chacha20-poly1305'}

Jose\Component\Encryption\Algorithm\KeyEncryption\A128CTR:
tags:
- {'name': 'jose.algorithm', 'alias': 'A128CTR'}
Jose\Component\Encryption\Algorithm\KeyEncryption\A256CTR:
tags:
- {'name': 'jose.algorithm', 'alias': 'A256CTR'}

Jose\Component\Encryption\Algorithm\KeyEncryption\RSAOAEP384:
tags:
- {'name': 'jose.algorithm', 'alias': 'RSA-OAEP-384'}

Jose\Component\Encryption\Algorithm\KeyEncryption\RSAOAEP512:
tags:
- {'name': 'jose.algorithm', 'alias': 'RSA-OAEP-512'}


Jose\Component\Encryption\Algorithm\ContentEncryption\A128CCM_16_64:
tags:
- {'name': 'jose.algorithm', 'alias': 'A128CCM-16-64'}
Jose\Component\Encryption\Algorithm\ContentEncryption\A128CCM_16_128:
tags:
- {'name': 'jose.algorithm', 'alias': 'A128CCM-16-128'}
Jose\Component\Encryption\Algorithm\ContentEncryption\A128CCM_64_64:
tags:
- {'name': 'jose.algorithm', 'alias': 'A128CCM-64-64'}
Jose\Component\Encryption\Algorithm\ContentEncryption\A128CCM_64_128:
tags:
- {'name': 'jose.algorithm', 'alias': 'A128CCM-64-128'}

Jose\Component\Encryption\Algorithm\ContentEncryption\A256CCM_16_64:
tags:
- {'name': 'jose.algorithm', 'alias': 'A256CCM-16-64'}
Jose\Component\Encryption\Algorithm\ContentEncryption\A256CCM_16_128:
tags:
- {'name': 'jose.algorithm', 'alias': 'A256CCM-16-256'}
Jose\Component\Encryption\Algorithm\ContentEncryption\A256CCM_64_64:
tags:
- {'name': 'jose.algorithm', 'alias': 'A256CCM-64-64'}
Jose\Component\Encryption\Algorithm\ContentEncryption\A256CCM_64_128:
tags:
- {'name': 'jose.algorithm', 'alias': 'A256CCM-64-256'}
13 changes: 13 additions & 0 deletions src/Bundle/JoseFramework/Resources/config/signature_algorithms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,16 @@ services:
Jose\Component\Signature\Algorithm\None:
tags:
- {'name': 'jose.algorithm', 'alias': 'none'}

# ---- New algorithms ----
# These algorithms are out of the main specifications but referenced in
# some WebAuthn documents.
#
# They may be subject to changes.
# ------------------------
Jose\Component\Signature\Algorithm\HS1:
tags:
- {'name': 'jose.algorithm', 'alias': 'HS1'}
Jose\Component\Signature\Algorithm\HS256_64:
tags:
- {'name': 'jose.algorithm', 'alias': 'HS256/64'}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php

declare(strict_types=1);

/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2018 Spomky-Labs
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/

namespace Jose\Component\Encryption\Algorithm\ContentEncryption;

final class A128CCM_16_128 extends AESCCM
{
/**
* {@inheritdoc}
*/
public function getCEKSize(): int
{
return 128;
}

/**
* {@inheritdoc}
*/
protected function getMode(): string
{
return 'aes-128-ccm';
}

/**
* {@inheritdoc}
*/
public function name(): string
{
return 'A128CCM-16-128';
}

protected function getTagLength(): int
{
return 16;
}

public function getIVSize(): int
{
return 13;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php

declare(strict_types=1);

/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2018 Spomky-Labs
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/

namespace Jose\Component\Encryption\Algorithm\ContentEncryption;

final class A128CCM_16_64 extends AESCCM
{
/**
* {@inheritdoc}
*/
public function getCEKSize(): int
{
return 128;
}

/**
* {@inheritdoc}
*/
protected function getMode(): string
{
return 'aes-128-ccm';
}

/**
* {@inheritdoc}
*/
public function name(): string
{
return 'A128CCM-16-64';
}

protected function getTagLength(): int
{
return 8;
}

public function getIVSize(): int
{
return 13;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php

declare(strict_types=1);

/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2018 Spomky-Labs
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/

namespace Jose\Component\Encryption\Algorithm\ContentEncryption;

final class A128CCM_64_128 extends AESCCM
{
/**
* {@inheritdoc}
*/
public function getCEKSize(): int
{
return 128;
}

/**
* {@inheritdoc}
*/
protected function getMode(): string
{
return 'aes-128-ccm';
}

/**
* {@inheritdoc}
*/
public function name(): string
{
return 'A128CCM-64-128';
}

protected function getTagLength(): int
{
return 16;
}

public function getIVSize(): int
{
return 7;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php

declare(strict_types=1);

/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2018 Spomky-Labs
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/

namespace Jose\Component\Encryption\Algorithm\ContentEncryption;

final class A128CCM_64_64 extends AESCCM
{
/**
* {@inheritdoc}
*/
public function getCEKSize(): int
{
return 128;
}

/**
* {@inheritdoc}
*/
protected function getMode(): string
{
return 'aes-128-ccm';
}

/**
* {@inheritdoc}
*/
public function name(): string
{
return 'A128CCM-64-64';
}

protected function getTagLength(): int
{
return 8;
}

public function getIVSize(): int
{
return 7;
}
}
Loading