There are very simple ways to test for primality, but they're... slow. (And at that level, the "in Java" part of the question doesn't make any sense. "What cryptography libraries do you use in Java?" is a perfectly sensible question. "How do you divide numbers in Java?"....)
No comments yet.