Simple java impelementation for public-key alogrithm