java.lang.Object
ml.karmaconfigs.api.common.utils.security.data.PBECryptoAPI

public class PBECryptoAPI extends Object
Initialize the crypto API
  • Constructor Details

    • PBECryptoAPI

      public PBECryptoAPI(String pwd, byte[] ctn)
      Initialize the crypt API
      Parameters:
      pwd - the password
      ctn - the content
  • Method Details

    • generateSALT

      public final byte[] generateSALT()
      Generate a salt token
      Returns:
      a sal token
    • encrypt

      public final byte[] encrypt(byte[] salt) throws Exception
      Encrypt the data
      Parameters:
      salt - the salt token
      Returns:
      the encrypted data
      Throws:
      Exception - if something goes wrong
    • decrypt

      public final byte[] decrypt(byte[] salt) throws Exception
      Decrypt the data
      Parameters:
      salt - the salt token
      Returns:
      the decrypted data
      Throws:
      Exception - if something goes wrong