Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jasypt.util.numeric
Class BasicIntegerNumberEncryptor

    Object
      org.jasypt.util.numeric.BasicIntegerNumberEncryptor

All Implemented Interfaces:
  IntegerNumberEncryptor

    public final class BasicIntegerNumberEncryptor

extends Object
implements IntegerNumberEncryptor

Utility class for easily performing normal-strength encryption of BigInteger objects.

This class internally holds a `StandardPBEBigIntegerEncryptor` configured this way:

- Algorithm: `PBEWithMD5AndDES`.
- Key obtention iterations: `1000`.

The required steps to use it are:

1. Create an instance (using `new`).
2. Set a password (using ``setPassword(String)`` or ``setPasswordCharArray(char[])``).
3. Perform the desired ``encrypt(BigInteger)`` or ``decrypt(BigInteger)`` operations.

This class is thread-safe.

Since:
  1.2
Author:
  Daniel Fernández

Constructor Summary
`BasicIntegerNumberEncryptor()` Creates a new instance of `BasicIntegerNumberEncryptor`.

Method Summary
`java.math.BigInteger` | `decrypt(java.math.BigInteger encryptedNumber)` Decrypts a number.
`java.math.BigInteger` | `encrypt(java.math.BigInteger number)` Encrypts a number
`void` | `setPassword(String password)` Sets a password.
`void` | `setPasswordCharArray(char[] password)` Sets a password, as a char[].

Methods inherited from class Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### BasicIntegerNumberEncryptor

    public BasicIntegerNumberEncryptor()

  Creates a new instance of `BasicIntegerNumberEncryptor`.

Method Detail

### setPassword

    public void setPassword(String password)

  Sets a password.

  Parameters:
    `password` - the password to be set.

### setPasswordCharArray

    public void setPasswordCharArray(char[] password)

  Sets a password, as a char[].

  Parameters:
    `password` - the password to be set.
  Since:
    1.8

### encrypt

    public java.math.BigInteger encrypt(java.math.BigInteger number)

  Encrypts a number

  Specified by:
    `encrypt` in interface `IntegerNumberEncryptor`
  Parameters:
    `number` - the number to be encrypted.
  See Also:
    `StandardPBEBigIntegerEncryptor.encrypt(BigInteger)`

### decrypt

    public java.math.BigInteger decrypt(java.math.BigInteger encryptedNumber)

  Decrypts a number.

  Specified by:
    `decrypt` in interface `IntegerNumberEncryptor`
  Parameters:
    `encryptedNumber` - the number to be decrypted.
  See Also:
    `StandardPBEBigIntegerEncryptor.decrypt(BigInteger)`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2014 The JASYPT team. All Rights Reserved.