Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Generate random key for encryption module

Hi all,

I have defined a custom PI module for encrypt and decrypt fields in a xml,

For encrypt and decrypt the fields I'm using a varible=key array byte[], I need this varible is diferent in the several executions, for this reason I have the next code suurce where I asiggn a value to the variable Key with a random:

private  byte[] secretKey=new byte[8];

Random random= new Random();

random.setSeed(System.currentTimeMillis());

random.nextBytes(secretKey);

but the problem is that always have the same coding in the several executions,I dont understand where is the problem.

Thanks and best regards.

Mónica

Not what you were looking for? View more on this topic or Ask a question