/// <summary>
        /// Use this simple encryption method to encrypt Vector2 components, uses passed crypto key.
        /// </summary>
        public static RawEncryptedVector2 Encrypt(float x, float y, int key)
        {
            if (key == 0)
            {
                key = cryptoKey;
            }

            RawEncryptedVector2 result;

            result.x = ObscuredFloat.Encrypt(x, key);
            result.y = ObscuredFloat.Encrypt(y, key);

            return(result);
        }
        /// <summary>
        /// Use this simple encryption method to encrypt Quaternion components, uses passed crypto key.
        /// Please note, passed components are not an Euler Angles.
        /// </summary>
        public static RawEncryptedQuaternion Encrypt(float x, float y, float z, float w, int key)
        {
            if (key == 0)
            {
                key = cryptoKey;
            }

            RawEncryptedQuaternion result;

            result.x = ObscuredFloat.Encrypt(x, key);
            result.y = ObscuredFloat.Encrypt(y, key);
            result.z = ObscuredFloat.Encrypt(z, key);
            result.w = ObscuredFloat.Encrypt(w, key);

            return(result);
        }
示例#3
0
        private int InternalEncryptField(float encrypted)
        {
            var result = ObscuredFloat.Encrypt(encrypted, cryptoKey);

            return(result);
        }