Skip to Content
Former Member
May 28, 2014 at 02:22 PM

Encryption key for Android SMP application



I am trying to register a user on SMP through an Android application using this example:

When calling ApplicationVariables.userManager.registerUser(false); I get a Null pointer exception with no further details. Before the Null pointer exception the following message appears:

encryption key is null. Terminating execution of pending requests.

I have tried the following to fix the problem:

try {

if(ApplicationVariables.cypherkey == null) {

ApplicationVariables.cypherkey = EncryptionKeyManager.getEncryptionKey(getApplicationContext());

} else {



} catch (PersistenceException e) {



From what I understand the line EncryptionKeyManager.getEncryptionKey(getApplicationContext() is meant to generate the key. When I do this the application goes into that catch and complains once again about the key being null.

How should I be generating the key? Should I be doing this in a custom manner and setting it using the EncryptionKeyManager.setEncryptionKey(ApplicationVariables.cypherkey,getApplicationContext()); ?