Creating an OS for Android Licensing

I would like to implement licensing in my application and need some help here.

An example application has the following:

// REPLACE WITH YOUR OWN SALT , THIS IS FROM EXAMPLE private static final byte[] SALT = new byte[]{ -46, 65, 30, -128, -103, -57, 74, -64, 51, 88, -95, -45, 77, -117, -36, -113, -11, 32, -64, 89 }; 

I would like to know if I am simply changing numbers to a random number or do I need to generate it using SecureRandom ?

I came across this code , do I need to set the SALT variable from the clipboard?

Also, should SALT be different for each device or the same?

+4
source share
2 answers

No random salt will not be very safe, theoretically someone can generate every combo for your application (however this is unlikely).

I suggest you take a look at RSA public key cryptography. You can take a look at How to use public encryption to manage licensing in Android applications? .

Editing: at first I was a bit unclear in the question of your question, Android: do random SALT bytes need to be passed to AESObfuscator so that they stay the same? I think this is a duplicate for which there is an answer.

+2
source

You can put any 20 bytes randomly generated. I think you can use the following generator for this purpose:

http://www.random.org/integers/?num=20&min=0&max=255&col=5&base=10&format=html&rnd=new

+1
source

Source: https://habr.com/ru/post/1487990/


All Articles