code: public String encrypt64( final String clearText, final String password )
      throws PlexusCipherException
      {
          try
          {
              byte[] clearBytes = clearText.getBytes( STRING_ENCODING );
      
              byte[] salt = getSalt( SALT_SIZE );
              
              Cipher cipher = createCipher( password.getBytes( STRING_ENCODING ), salt, Cipher.ENCRYPT_MODE  );
      
              byte [] encryptedBytes = cipher.doFinal( clearBytes );
              
              int len = encryptedBytes.length;
              
              byte padLen = (byte) ( CHUNK_SIZE - (SALT_SIZE + len + 1) % CHUNK_SIZE );
              
              int totalLen = SALT_SIZE + len + padLen + 1;
              
              byte [] allEncryptedBytes = getSalt( totalLen );
              
              System.arraycopy( salt, 0, allEncryptedBytes, 0, SALT_SIZE );
              
              allEncryptedBytes[ SALT_SIZE ] = padLen;
              
              System.arraycopy( encryptedBytes, 0, allEncryptedBytes, SALT_SIZE + 1, len );
              
              byte [] encryptedTextBytes = Base64.encodeBase64( allEncryptedBytes );
              
              String encryptedText = new String( encryptedTextBytes, STRING_ENCODING );
      
              return encryptedText;
          }
          catch( Exception e)
          {
              throw new PlexusCipherException(e);
          }
      }
docs: -------------------------------------------------------------------------------