importing file

This commit is contained in:
Henry Varona 2016-12-01 17:03:23 -04:30
parent a98df1369f
commit ed21b70ba2
2 changed files with 4 additions and 2 deletions

View file

@ -54,8 +54,10 @@ public abstract class FileBin {
ECKey randomECKey = ECKey.fromPublicOnly(publicKey);
byte[] finalKey = randomECKey.getPubKeyPoint().multiply(ECKey.fromPrivate(md.digest(password.getBytes("UTF-8"))).getPrivKey()).normalize().getXCoord().getEncoded();
MessageDigest md1 = MessageDigest.getInstance("SHA-512");
finalKey = md1.digest(finalKey);
rawData = decryptAES(rawData, byteToString(finalKey).getBytes());
byte[] checksum = new byte[4];
System.arraycopy(rawData, 0, checksum, 0, 4);
byte[] compressedData = new byte[rawData.length-4];

View file

@ -731,6 +731,6 @@ public class Test {
public void testCreateBinFile(){
byte[] fileOutput = FileBin.getBytesFromBrainKey(Main.BRAIN_KEY, "123456","bithon-83");
System.out.println("fileOutput " + Arrays.toString(fileOutput));
System.out.println(FileBin.getBrainkeyFromByte(fileOutput, "123456"));
}
}