encryption - Encrypt a hex string in java -
I want to ask about any suggestions about my problem. I need to encrypt the hexadecimal string I should not use Java's built-in functions because it does not work in my server. In essence, I have to work hard for any means of encrypting an algorithm or message. Who can help me with this? Thanks a lot!
Here is the code.
Public encryption (secret key, string algorithm) {try {ecipher = cipher.getInstance (algorithm); Dicser = cipher Instant (algorithm); Ecipher.init (cipher NCRYP_MODE, key); Dcipher.init (cipher .DERCP_MODEG, key); } Hold (Nowchpending Exception E) {System.out.println ("Exception: Noschpending Exception"); } Hold (Knowledge Algorithm Execution E) {System.out.println ("Exception: No esche algorithm expedition"); } Hold (Invalid KeyException E) {System.out.println ("Exception: Invalid Exception"); }} Public Zero used to be safeguarded that (string secret string) {{secrety de kake = main generator.stustinstance ("DES"). Generate (); The Secret of the Blowfish = Key Generator Instance ("Blowfish") Generation (); SecretKey desedeKey = KeyGenerator.getInstance ("DESede"). GenerateKey (); Encrypt desEncrypter = new encrypt (desKey, desKey.getAlgorithm ()); Encrypt Buffyfish Encryptter = New Encrypt (Blufffishki, Blowfishki.A.A.L.Oligrithm ()); Encrypt desedeEncrypter = new encrypt (desedeKey, desedeKey.getAlgorithm ()); DesEncrypted = desEncrypter.encrypt (secretString); Bluefish encrypted = bufffish encryptor. Encrypt (sextest); DesedeEncrypted = desedeEncrypter.encrypt (Guptstroke); } Hold (NoSuchAlgorithmException E) {}}
Those methods I have used have no problem if it is run as an application, but then when I keep it on my server I have an exception that the glassfish server is an exception and there is no such algorithm.
Comments
Post a Comment