public void TestGermanCharsEncryption() { pn = EditorCommon.InitPN(pnConfig); PubnubCrypto pubnubCrypto = new PubnubCrypto("enigma", PNLog); string message = "ÜÖ"; message = EditorCommon.Serialize(message); string encrypted = pubnubCrypto.Encrypt(message); Assert.True(("stpgsG1DZZxb44J7mFNSzg==").Equals(encrypted)); }
public void TestUnicodeCharsEncryption() { pn = EditorCommon.InitPN(pnConfig); PubnubCrypto pubnubCrypto = new PubnubCrypto("enigma", PNLog); string message = "漢語"; message = EditorCommon.Serialize(message); string encrypted = pubnubCrypto.Encrypt(message); Assert.That(("+BY5/miAA8aeuhVl4d13Kg==").Equals(encrypted)); }
public void TestObjectEncryption() { pn = EditorCommon.InitPN(pnConfig); PubnubCrypto pubnubCrypto = new PubnubCrypto("enigma", PNLog); //create an object Object obj = new Object(); //serialize string strObj = EditorCommon.Serialize(obj); //encrypt string encrypted = pubnubCrypto.Encrypt(strObj); Assert.True(("IDjZE9BHSjcX67RddfCYYg==").Equals(encrypted)); }
public void TestArrayEncryption() { pn = EditorCommon.InitPN(pnConfig); PubnubCrypto pubnubCrypto = new PubnubCrypto("enigma", PNLog); //create an empty array object object[] objArr = { }; string strArr = EditorCommon.Serialize(objArr); //Encrypt string encrypted = pubnubCrypto.Encrypt(strArr); Assert.True(("Ns4TB41JjT2NCXaGLWSPAQ==").Equals(encrypted)); }
public void TestPubNubEncryption1() { pn = EditorCommon.InitPN(pnConfig); PubnubCrypto pubnubCrypto = new PubnubCrypto("enigma", PNLog); //non serialized string string message = "Pubnub Messaging API 1"; //serialize message = EditorCommon.Serialize(message); //encrypt string encrypted = pubnubCrypto.Encrypt(message); Assert.True(("f42pIQcWZ9zbTbH8cyLwByD/GsviOE0vcREIEVPARR0=").Equals(encrypted)); }
public void TestPubNubEncryption2() { pn = EditorCommon.InitPN(pnConfig); PubnubCrypto pubnubCrypto = new PubnubCrypto("enigma", PNLog); //Deserialized string message = "Pubnub Messaging API 2"; //serialize the message message = EditorCommon.Serialize(message); //encrypt string encrypted = pubnubCrypto.Encrypt(message); Assert.True(("f42pIQcWZ9zbTbH8cyLwB/tdvRxjFLOYcBNMVKeHS54=").Equals(encrypted)); }
public void TestYayEncryption() { pn = EditorCommon.InitPN(pnConfig); PubnubCrypto pubnubCrypto = new PubnubCrypto("enigma", PNLog); //deserialized string string message = "yay!"; //serialize the string message = EditorCommon.Serialize(message); //Encrypt string encrypted = pubnubCrypto.Encrypt(message); Assert.True(("Wi24KS4pcTzvyuGOHubiXg==").Equals(encrypted)); }
public void TestMyObjectEncryption() { pn = EditorCommon.InitPN(pnConfig); PubnubCrypto pubnubCrypto = new PubnubCrypto("enigma", PNLog); //create an object of the custom class CustomClass cc = new CustomClass(); //serialize it string result = EditorCommon.Serialize(cc); //encrypt it string encrypted = pubnubCrypto.Encrypt(result); UnityEngine.Debug.Log("encrypted:" + encrypted); UnityEngine.Debug.Log("result:" + result); Assert.True(("Zbr7pEF/GFGKj1rOstp0tWzA4nwJXEfj+ezLtAr8qqE=").Equals(encrypted)); }
public void TestObjectDecryption() { pn = EditorCommon.InitPN(pnConfig); PubnubCrypto pubnubCrypto = new PubnubCrypto("enigma", PNLog); //Deserialized string message = "IDjZE9BHSjcX67RddfCYYg=="; //Decrypt string decrypted = pubnubCrypto.Decrypt(message); //create an object Object obj = new Object(); //Serialize the object string result = EditorCommon.Serialize(obj); Assert.True((decrypted).Equals(result)); }
public void TestArrayDecryption() { pn = EditorCommon.InitPN(pnConfig); PubnubCrypto pubnubCrypto = new PubnubCrypto("enigma", PNLog); //Input the deserialized string string message = "Ns4TB41JjT2NCXaGLWSPAQ=="; //decrypt string decrypted = pubnubCrypto.Decrypt(message); //create a serialized object object[] objArr = { }; string result = EditorCommon.Serialize(objArr); //compare the serialized object and the return of the Decrypt method Assert.True((result).Equals(decrypted)); }