code: public static String encrypt(String key, String source) {
          try {
              // Get our secret key
              Key key0 = getKey(key);
              // Create the cipher
              Cipher desCipher = Cipher.getInstance("DES/ECB/PKCS5Padding");
              // Initialize the cipher for encryption
              desCipher.init(Cipher.ENCRYPT_MODE, key0);
              // Our cleartext as bytes
              byte[] cleartext = source.getBytes();
              // Encrypt the cleartext
              byte[] ciphertext = desCipher.doFinal(cleartext);
              // convert to Base64
              //byte[] b64cipherText = Base64.encodeBase64(ciphertext);
              // Return a String representation of the cipher text
              //return StringUtil.getAsciiString(b64cipherText);
              // replaced Jakarta Base64 with custom one
              return Base64Codec.encode(ciphertext);
          } catch (Exception e) {
              throw new RuntimeException(e.getMessage());
          }
      }
docs: Uses the key to encrypt the source string into a base-64
  encoded string using a DES/ECB/PKCS5Padding cipher.
  @param key The key to use for encryption.  Must be at least 8 characters
  in length.
  @param source The plain-text to encrypt.
  @return A Base-64 encoded encypted string.  Its safe to assume that the
  encrypted string will be at least twice the size of the plain-text.