I’ve been working on a little application which grabs strings embedded within a picture, which in turn are used to calculate 2 big integers for use in a key exchange system. However, when I try and read the strings from a properties file, and implement them into a bigint:
String primeStr = "ekoeaokimcgmigcqu{uq{y}sw}ywsAEKOEAOKIMCGMIGCQU[_UQ_[Y]SW]YWS!%+/%!/+)-#'-)'#15;?51?;9=37=973"
BigInteger prime = new BigInteger(this.primeStr,10);
I’m thrown an error about the string not being correct. My question is how would I solve the issue so I can use that string within the app?
The
Stringconstructor ofBigIntegerexpects a number, if yourprimeStrvariable somehow encodes a number you’ll have to decode it first before passing it toBigInteger.