title: How to Encrypt data to a Plain text without Special character in java
body: <p>I need a encryption algorithm by whick I can encrypt the data to a simple plain text.</p>
  <p>Currently i am using <strong>AES</strong>  <strong>encrypting algorithm</strong> which converts to encrypt string contains Special character.</p>
  <p>Here if i send this string through a query string in url I am missing some character like- &quot;+&quot;.</p>
  <p>So i need a encrypt logic which is secure and contains only alphabet.</p>
  <p>Here is my encryption logic :</p>
  <pre><code>      public static String encrypt(String Data) throws Exception {
          Key key = generateKey();
          Cipher c = Cipher.getInstance(ALGO);
          c.init(Cipher.ENCRYPT_MODE, key);
          byte[] encVal = c.doFinal(Data.getBytes());
          String encryptedValue = new BASE64Encoder().encode(encVal);
          return encryptedValue;
      }
  
      @SuppressWarnings(&quot;restriction&quot;)
      public static String decrypt(String encryptedData) throws Exception {
          Key key = generateKey();
          Cipher c = Cipher.getInstance(ALGO);
          c.init(Cipher.DECRYPT_MODE, key);
          byte[] decordedValue = new BASE64Decoder().decodeBuffer(encryptedData);
          byte[] decValue = c.doFinal(decordedValue);
          String decryptedValue = new String(decValue);
          return decryptedValue;
      }
  </code></pre>
  <p>Here I am getting an encrypted String  &quot;<strong>TEj+TWBQExpz8/p5SAjIhA==</strong>&quot;</p>
  <p>while I am sending through query string as</p>
  <p><strong>localhost:8080/myproject/home?code=TEj+TWBQExpz8/p5SAjIhA==</strong></p>
  <p>i am getting the String in <strong>controller</strong> as-<br />
  &quot;<strong>TEj TWBQExpz8/p5SAjIhA==</strong>&quot;</p>
  <p>&quot;+&quot; symbol is missing thats why i am getting issue while decryption.</p>
  <p>Please suggest any new Algorithm or any solution to avoid the Special character.</p>
  <p>Thank you.</p>