public static byte[] encryptWithAES(final byte[] data, final byte[] key) {
        final byte[] encrypted = new byte[data.length];
        final CipherParameters cipherParameters = new KeyParameter(key);
        final AESLightEngine engine = new AESLightEngine();
        engine.init(true, cipherParameters);
        engine.processBlock(data, 0, encrypted, 0);

        return encrypted;
    }
Calculates hash value for advertising with node id

@param identityKey resolving identity key
@param random      64-bit random value
@param src         unicast address of the node
@return hash value
mesh/src/main/java/no/nordicsemi/android/mesh/utils/SecureUtils.java