Class EncryptUtil


  • public class EncryptUtil
    extends Object
    Author:
    Pavel.Sher Date: 16.04.2008
    • Constructor Detail

      • EncryptUtil

        public EncryptUtil()
    • Method Detail

      • md5

        public static String md5​(String str)
        Generates MD5 hash from the specified string and returns result in the hex format.
        Parameters:
        str - string
        Returns:
        MD5 hash
      • toHex

        public static String toHex​(byte[] bytes)
        Accepts bytes and returns string with hex representation of these bytes
        Parameters:
        bytes - bytes to convert to hex
        Returns:
        hex representation of bytes
      • fromHex

        public static byte[] fromHex​(String hex)
        Converts hex representation to corresponding bytes
        Parameters:
        hex - hex representation of bytes sequence
        Returns:
        bytes sequence
      • isScrambled

        public static boolean isScrambled​(String scrambled)
        Parameters:
        scrambled - input text
        Returns:
        true if input string is scrambled
      • scrambleValue

        @Deprecated
        public static String scrambleValue​(String value)
        Deprecated.
        Scrambles value using the specified secret key (must be 24 bytes length)
        Parameters:
        value - to scramble
        Returns:
        scrambled value
      • scramble

        public static String scramble​(@NotNull
                                      String value)
        Scrambles value using
        Parameters:
        value - to scramble
        Returns:
        scrambled value