getDefaultCipherSalt
🧂 REL-ID SDK API Documentation: getDefaultCipherSalt
📘 Overview
The getDefaultCipherSalt
API returns the default salt value used for cryptographic operations like encryption and decryption. The salt adds entropy and uniqueness to the cipher operations and ensures enhanced security by preventing dictionary attacks.
This API is meant to be used along with getDefaultCipherSpec
for configuring REL-ID cryptographic functions such as encryptDataPacket()
and decryptDataPacket()
.
🎯 Purpose
Use this API to retrieve the system-defined salt value (e.g., the app’s package or bundle ID) to be used consistently for encryption/decryption.
🔁 API Flow
- Call
getDefaultCipherSalt()
- Use the returned salt string in
encryptDataPacket()
anddecryptDataPacket()
🧾 Response
Returns a string, typically the app’s identifier or package name.
🔧 Example:
com.uniken.mybank
💻 Code Snippets
React Native
RdnaClient.getDefaultCipherSalt((response) => {
console.log("Default Cipher Salt:", response);
});
Flutter
final cipherSalt = await rdnaClient.getDefaultCipherSalt();
Cordova
com.uniken.rdnaplugin.RdnaClient.getDefaultCipherSalt(successCallback, errorCallback);
Native iOS
(RDNAError *)getDefaultCipherSalt:(NSMutableString **)cipherSalt;
Native Android
RDNAStatus<byte[]> getDefaultCipherSalt();
🧠 Developer Notes
- Always pair this with
getDefaultCipherSpec()
to maintain consistency. - Avoid hardcoding salt values unless you need to override the default for specific scenarios.
Updated 2 months ago