Decrypt() 공개 추상적인 메소드

public abstract Decrypt ( ArraySegment src, ArraySegment dst, string in_header ) : System.Int64
src ArraySegment
dst ArraySegment
in_header string
리턴 System.Int64
예제 #1
0
        protected bool decryptMessage(ArraySegment <byte> buffer, string encryption_type, string encryption_header)
        {
            EncryptionType type = (EncryptionType)Convert.ToInt32(encryption_type);

            if (!encryptors_.ContainsKey(type))
            {
                Log("Unknown encryption: {0}", type);
                return(false);
            }

            Encryptor encryptor = encryptors_[type];

            if (encryptor == null)
            {
                Log("Invalid encryption: {0}", type);
                return(false);
            }

            Int64 nSize = encryptor.Decrypt(buffer, buffer, encryption_header);

            if (nSize <= 0)
            {
                Log("Failed to decrypt.");
                return(false);
            }

            return(true);
        }
예제 #2
0
        protected bool decryptMessage(ArraySegment <byte> buffer, string encryption_type, string encryption_header)
        {
            EncryptionType type = (EncryptionType)Convert.ToInt32(encryption_type);

            if (type == EncryptionType.kDummyEncryption)
            {
                return(true);
            }

            if (!encryptors_.ContainsKey(type))
            {
                debug.LogWarning("Encryptor.decryptMessage - Unavailable type: {0}", type);
                return(false);
            }

            Encryptor encryptor = encryptors_[type];
            Int64     nSize     = encryptor.Decrypt(buffer, buffer, encryption_header);

            if (nSize <= 0)
            {
                debug.LogWarning("Encryptor.decryptMessage - Failed to decrypt.");
                return(false);
            }

            return(true);
        }