Go to the documentation of this file.
20package org.sleuthkit.autopsy.coreutils;
22import java.util.Base64;
23import javax.crypto.Cipher;
24import javax.crypto.SecretKey;
25import javax.crypto.SecretKeyFactory;
26import javax.crypto.spec.PBEKeySpec;
27import javax.crypto.spec.PBEParameterSpec;
28import org.openide.util.NbBundle;
35 private static final char[]
KEY =
"hgleri21auty84fwe".toCharArray();
36 private static final byte[]
SALT = {(byte) 0xde, (
byte) 0x33, (byte) 0x10, (
byte) 0x12, (byte) 0xde, (
byte) 0x33, (byte) 0x10, (
byte) 0x12};
49 SecretKeyFactory keyFactory = SecretKeyFactory.getInstance(
"PBEWithMD5AndDES");
50 SecretKey key = keyFactory.generateSecret(
new PBEKeySpec(
KEY));
51 Cipher pbeCipher = Cipher.getInstance(
"PBEWithMD5AndDES");
52 pbeCipher.init(Cipher.ENCRYPT_MODE, key,
new PBEParameterSpec(
SALT, 20));
53 return Base64.getEncoder().encodeToString(pbeCipher.doFinal(property.getBytes(
"UTF-8")));
54 }
catch (Exception ex) {
70 SecretKeyFactory keyFactory = SecretKeyFactory.getInstance(
"PBEWithMD5AndDES");
71 SecretKey key = keyFactory.generateSecret(
new PBEKeySpec(
KEY));
72 Cipher pbeCipher = Cipher.getInstance(
"PBEWithMD5AndDES");
73 pbeCipher.init(Cipher.DECRYPT_MODE, key,
new PBEParameterSpec(
SALT, 20));
74 return new String(pbeCipher.doFinal(Base64.getDecoder().decode(property)),
"UTF-8");
75 }
catch (Exception ex) {
static String convertHexTextToText(String property)
static String convertTextToHexText(String property)
Copyright © 2012-2024 Sleuth Kit Labs. Generated on:
This work is licensed under a
Creative Commons Attribution-Share Alike 3.0 United States License.