mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-14 19:59:05 +01:00
Upgraded hash function to SHA-384 and MAC to HMAC-SHA-384.
This matches the security level of AES-256 according to NSA Suite B. To better comply with Suite B we should replace the combination of CTR mode and HMAC with GCM, which would reduce the MAC size from 48 to 16 bytes.
This commit is contained in:
@@ -25,16 +25,16 @@ class CryptoComponentImpl implements CryptoComponent {
|
||||
|
||||
private static final String PROVIDER = "BC";
|
||||
private static final String KEY_PAIR_ALGO = "ECDSA";
|
||||
private static final int KEY_PAIR_BITS = 256;
|
||||
private static final int KEY_PAIR_BITS = 384;
|
||||
private static final String SECRET_KEY_ALGO = "AES";
|
||||
private static final int SECRET_KEY_BYTES = 32; // 256 bits
|
||||
private static final int KEY_DERIVATION_IV_BYTES = 16; // 128 bits
|
||||
private static final String KEY_DERIVATION_ALGO = "AES/CTR/NoPadding";
|
||||
private static final String DIGEST_ALGO = "SHA-256";
|
||||
private static final String DIGEST_ALGO = "SHA-384";
|
||||
private static final String SIGNATURE_ALGO = "ECDSA";
|
||||
private static final String TAG_CIPHER_ALGO = "AES/ECB/NoPadding";
|
||||
private static final String FRAME_CIPHER_ALGO = "AES/CTR/NoPadding";
|
||||
private static final String MAC_ALGO = "HMacSHA256";
|
||||
private static final String MAC_ALGO = "HMacSHA384";
|
||||
|
||||
// Labels for key derivation, null-terminated
|
||||
private static final byte[] TAG = { 'T', 'A', 'G', 0 };
|
||||
|
||||
@@ -24,7 +24,7 @@ import com.google.inject.Inject;
|
||||
/** Contains all the H2-specific code for the database. */
|
||||
class H2Database extends JdbcDatabase {
|
||||
|
||||
private static final String HASH_TYPE = "BINARY(32)";
|
||||
private static final String HASH_TYPE = "BINARY(48)";
|
||||
private static final String BINARY_TYPE = "BINARY";
|
||||
private static final String COUNTER_TYPE = "INT NOT NULL AUTO_INCREMENT";
|
||||
private static final String SECRET_TYPE = "BINARY(32)";
|
||||
|
||||
@@ -37,7 +37,8 @@ class BluetoothPlugin implements DuplexPlugin {
|
||||
|
||||
public static final byte[] TRANSPORT_ID =
|
||||
StringUtils.fromHexString("d99c9313c04417dcf22fc60d12a187ea"
|
||||
+ "00a539fd260f08a13a0d8a900cde5e49");
|
||||
+ "00a539fd260f08a13a0d8a900cde5e49"
|
||||
+ "1b4df2ffd42e40c408f2db7868f518aa");
|
||||
|
||||
private static final TransportId ID = new TransportId(TRANSPORT_ID);
|
||||
private static final Logger LOG =
|
||||
|
||||
@@ -21,7 +21,8 @@ implements RemovableDriveMonitor.Callback {
|
||||
|
||||
public static final byte[] TRANSPORT_ID =
|
||||
StringUtils.fromHexString("7c81bf5c9b1cd557685548c85f976bbd"
|
||||
+ "e633d2418ea2e230e5710fb43c6f8cc0");
|
||||
+ "e633d2418ea2e230e5710fb43c6f8cc0"
|
||||
+ "68abca3a9d0edb13bcea13b851725c5d");
|
||||
|
||||
private static final TransportId ID = new TransportId(TRANSPORT_ID);
|
||||
private static final Logger LOG =
|
||||
|
||||
@@ -25,7 +25,8 @@ class SimpleSocketPlugin extends SocketPlugin {
|
||||
|
||||
public static final byte[] TRANSPORT_ID =
|
||||
StringUtils.fromHexString("58c66d999e492b85065924acfd739d80"
|
||||
+ "c65a62f87e5a4fc6c284f95908b9007d");
|
||||
+ "c65a62f87e5a4fc6c284f95908b9007d"
|
||||
+ "512a93ebf89bf68f50a29e96eebf97b6");
|
||||
|
||||
private static final TransportId ID = new TransportId(TRANSPORT_ID);
|
||||
private static final Logger LOG =
|
||||
|
||||
@@ -34,7 +34,8 @@ class TorPlugin implements DuplexPlugin {
|
||||
|
||||
public static final byte[] TRANSPORT_ID =
|
||||
StringUtils.fromHexString("f264721575cb7ee710772f35abeb3db4"
|
||||
+ "a91f474e14de346be296c2efc99effdd");
|
||||
+ "a91f474e14de346be296c2efc99effdd"
|
||||
+ "f35921e6ed87a25c201f044da4767981");
|
||||
|
||||
private static final TransportId ID = new TransportId(TRANSPORT_ID);
|
||||
private static final Logger LOG =
|
||||
|
||||
Reference in New Issue
Block a user