Class DefaultCryptor

java.lang.Object
org.apache.commons.vfs2.util.DefaultCryptor
All Implemented Interfaces:
Cryptor

public class DefaultCryptor extends Object implements Cryptor
Allows passwords to be encrypted and decrypted.

Warning: This uses AES128 with a fixed encryption key. This is only an obfuscation no cryptographic secure protection.

Since:
2.0
  • Constructor Details

  • Method Details

    • decrypt

      public String decrypt(String encryptedKey) throws Exception
      Decrypts the password.
      Specified by:
      decrypt in interface Cryptor
      Parameters:
      encryptedKey - the encrypted password.
      Returns:
      The plain text password.
      Throws:
      Exception - If an error occurs.
    • encrypt

      public String encrypt(String plainKey) throws Exception
      Encrypt the plain text password.

      Warning: This uses AES128 with a fixed encryption key. This is only an obfuscation no cryptographic secure protection.

      Specified by:
      encrypt in interface Cryptor
      Parameters:
      plainKey - The password.
      Returns:
      The encrypted password String.
      Throws:
      Exception - If an error occurs.