title: Encode a String into a BigInteger then decode back to String
body: <p><em>I found an answer that almost solves my problem:
  <a href="https://stackoverflow.com/a/5717191/1065546">https://stackoverflow.com/a/5717191/1065546</a></em></p>
  
  <p><em>This answer demonstrates how to encode a BigInteger into a String then back into a BigInteger using Base64 encodings which uses Apache commons-codec.</em> </p>
  
  <p>Is there a way of encoding technique/method for a String to a BigInteger then back to a String?
  if so would someone please explain how to use it?</p>
  
  <pre><code>      String s = "hello world";
        System.out.println(s);
  
        BigInteger encoded = new BigInteger( SOME ENCODING.(s));
        System.out.println(encoded);
  
        String decoded = new String(SOME DECODING.(encoded));
        System.out.println(decoded);
  </code></pre>
  
  <p>Print:</p>
  
  <pre><code>      hello world
        830750578058989483904581244
        hello world
  </code></pre>
  
  <p><em>(The output is just an example and hello world doesn't have to decode to that BigInteger)</em></p>
  
  <p><strong>EDIT</strong></p>
  
  <p>More specific:</p>
  
  <p>I am writing a RSA algorithm and I need to convert a message into a BigInteger so that I can then encrypt the message with the public key (send message) and then decrypt the message with the private key and then convert the number back into a String. </p>
  
  <p>I would like a method of conversion that could produce the smallest BigInteger as I was planning on using binary until I realised how ridiculouslybig the number would be.</p>