Home > Contents > Index >
Expanded TOC | Accordion TOC | Annotated TOC | Index
Utilities.decryptString
Decrypts a string.
This method has two variants:
- decryptString (Variant 1) decrypts a string with the default key using the DES algorithm.
- decryptString (Variant 2) decrypts a string with the key you used in encryptString (Variant 2) .
Utilities.decryptString
Decrypts a string with the default key using the DES algorithm.
Syntax
static String decryptString(String s)Parameters
s
- The string to decrypt.
Returns
Returns the decrypted string.
Example
if (Utilities.cryptoEnabled()) { String clear_text = "Attack at dawn."; String encrypted_text = Utilities.encryptString( clear_text ); String decrypted_text = Utilities.decryptString(encrypted_text); }See Also
Utilities.decryptString
Decrypts a string with the key you used in encryptString (Variant 2) .
Syntax
static String decryptString(String s, byte [] key)Parameters
s
- The string to decrypt.
key
- A byte array containing byte values that represents the key used by the encryption algorithm. The array should be at least 8 bytes long.
Returns
Returns the decrypted string.
See Also
Home > Contents > Index > Oracle JAVA Reference
Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.