The easiest way is through Pari/GP and Sage. The latter is Python based so it's relatevely easy to quickly work with it. However, if you are looking for performance look for MIRACL which is for C/C++ . For Java you have Bouncy Castle.
If you are new to this, then definitely go for Sage and grap this beauty "Introduction to Cryptography with Open-Source Software".
USe Pycrypto the python cryptographic tool kit. Python provides a good platform for text processing. In cryptography always we work with strings. Pycrypto is open source toolkit with more features for cryptographic functionalities.
I have seen your request for quite a while now and didn't answer yet because I had some downloads to Hanoi about a year ago and simply had assumed, this was you and you know Academic Signature already.
Just in case the guest on my pages from Hanoi had been someone else, let me give you the link: