コード例 #1
0
        /// <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);
        }
コード例 #2
0
        /// <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);
        }