pubnub / dart

PubNub Dart SDK
Other
28 stars 15 forks source link

Encrypt different result #104

Closed manarhidayat closed 1 year ago

manarhidayat commented 2 years ago

I have React Native app using Pubnup, and use it for encrypt my message

the config like this:

this.pubnub = new PubNub({
      subscribeKey: 'xxx',
      publishKey: 'xxx',
      uuid: 'default',
      useRandomIVs: false
    });

the function for encrypt:

this.pubnub.encrypt(message, 'cipherKey');

But when i try use Pubnup in Flutter app, i got different result

the config:

final cipherKey = CipherKey.fromUtf8("cipherKey");
final myKeyset = Keyset(
        cipherKey: cipherKey,
        subscribeKey: 'xxx',
        publishKey: 'xxx',
        userId: UserId('default'));

final CryptoModule cryptoModule = CryptoModule( defaultConfiguration: CryptoConfiguration(useRandomInitializationVector: false));

final pubnub = PubNub(defaultKeyset: myKeyset, crypto: cryptoModule);

the function for encrypt:

pubnub.crypto.encrypt(cipherKey, message)

flutter pubnub version : 4.2.1 react native pubnub version : 5.0.0