File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
sdk/src/main/java/io/opentdf/platform/sdk Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 1313import io .opentdf .platform .sdk .nanotdf .ECKeyPair ;
1414import org .apache .commons .codec .DecoderException ;
1515import org .apache .commons .codec .binary .Hex ;
16+ import org .bouncycastle .crypto .digests .SHA256Digest ;
1617import org .bouncycastle .jce .interfaces .ECPublicKey ;
1718import org .slf4j .Logger ;
1819import org .slf4j .LoggerFactory ;
3738 */
3839public class TDF {
3940
40- public static final byte [] GLOBAL_KEY_SALT = null ;
41+ private static byte [] tdfECKeySaltCompute () {
42+ byte [] salt ;
43+ try {
44+ MessageDigest digest = MessageDigest .getInstance ("SHA-256" );
45+ digest .update ("TDF" .getBytes ());
46+ salt = digest .digest ();
47+ } catch (NoSuchAlgorithmException e ) {
48+ throw new RuntimeException ("failed to compute salt for TDF" , e );
49+ }
50+ return salt ;
51+ }
52+
53+ public static final byte [] GLOBAL_KEY_SALT = tdfECKeySaltCompute ();
4154 private static final String EMPTY_SPLIT_ID = "" ;
4255 private static final String TDF_VERSION = "4.3.0" ;
4356 private static final String KEY_ACCESS_SECHMA_VERSION = "1.0" ;
You can’t perform that action at this time.
0 commit comments