Class JKSecurityUtil

java.lang.Object
com.jk.core.security.JKSecurityUtil

public final class JKSecurityUtil extends Object
The Class JKSecurityUtil.
  • Constructor Details

    • JKSecurityUtil

      public JKSecurityUtil()
  • Method Details

    • main

      public static void main(String[] args) throws Exception
      The main method.
      Parameters:
      args - the arguments
      Throws:
      Exception - the exception
    • encrypt

      public static String encrypt(byte[] plainText)
      Encrypt.
      Parameters:
      plainText - the plain text
      Returns:
      the byte[]
    • decrypt

      public static byte[] decrypt(String cipherBytes)
      Decrypt.
      Parameters:
      cipherBytes - the cipher bytes
      Returns:
      the byte[]
    • paddArray

      public static byte[] paddArray(byte[] original, int padding)
      Padd array.
      Parameters:
      original - the original
      padding - the padding
      Returns:
      the byte[]
    • decode

      public static String decode(String source)
      Decode.
      Parameters:
      source - the source
      Returns:
      the string
    • decodeFromBase64

      public static byte[] decodeFromBase64(String string)
      Decode from base 64.
      Parameters:
      string - the string
      Returns:
      the byte[]
    • encode

      public static String encode(String source)
      Encode.
      Parameters:
      source - the source
      Returns:
      the string
    • encodeInToBase64

      public static String encodeInToBase64(byte[] string)
      Encode in to base 64.
      Parameters:
      string - the string
      Returns:
      the string
    • salt

      public static byte[] salt()
      Salt.
      Returns:
      the byte[]
    • hash

      public static byte[] hash(char[] data, byte[] salt)
      Hash.
      Parameters:
      data - the data
      salt - the salt
      Returns:
      the byte[]
    • createPassword

      public static Password createPassword(char[] password)
      Creates the password.
      Parameters:
      password - the password
      Returns:
      the password
    • maskString

      public static String maskString(String text)
      Mask string.
      Parameters:
      text - the text
      Returns:
      the string
    • createPassword

      public static Password createPassword(String text)
      Creates the password.
      Parameters:
      text - the text
      Returns:
      the password