Exemplo n.º 1
0
        // Token: 0x0600007F RID: 127 RVA: 0x00005C18 File Offset: 0x00003E18
        public static int PK11SDR_Decrypt(ref FFDecryptor.TSECItem data, ref FFDecryptor.TSECItem result, int cx)
        {
            IntPtr pProc = FFDecryptor.GetProcAddress(FFDecryptor.NSS3, "PK11SDR_Decrypt");

            FFDecryptor.DLLFunctionDelegate5 dll = (FFDecryptor.DLLFunctionDelegate5)Marshal.GetDelegateForFunctionPointer(pProc, typeof(FFDecryptor.DLLFunctionDelegate5));
            return(dll(ref data, ref result, cx));
        }
Exemplo n.º 2
0
        // Token: 0x0600007E RID: 126 RVA: 0x00005B10 File Offset: 0x00003D10
        public static string Decrypt(string cypherText)
        {
            IntPtr        ffDataUnmanagedPointer = IntPtr.Zero;
            StringBuilder sb = new StringBuilder(cypherText);

            try
            {
                byte[] ffData = Convert.FromBase64String(cypherText);
                ffDataUnmanagedPointer = Marshal.AllocHGlobal(ffData.Length);
                Marshal.Copy(ffData, 0, ffDataUnmanagedPointer, ffData.Length);
                FFDecryptor.TSECItem tSecDec = default(FFDecryptor.TSECItem);
                FFDecryptor.TSECItem item    = default(FFDecryptor.TSECItem);
                item.SECItemType = 0;
                item.SECItemData = ffDataUnmanagedPointer;
                item.SECItemLen  = ffData.Length;
                bool flag = FFDecryptor.PK11SDR_Decrypt(ref item, ref tSecDec, 0) == 0;
                if (flag)
                {
                    bool flag2 = tSecDec.SECItemLen != 0;
                    if (flag2)
                    {
                        byte[] bvRet = new byte[tSecDec.SECItemLen];
                        Marshal.Copy(tSecDec.SECItemData, bvRet, 0, tSecDec.SECItemLen);
                        return(Encoding.ASCII.GetString(bvRet));
                    }
                }
            }
            catch
            {
                return(null);
            }
            finally
            {
                bool flag3 = ffDataUnmanagedPointer != IntPtr.Zero;
                if (flag3)
                {
                    Marshal.FreeHGlobal(ffDataUnmanagedPointer);
                }
            }
            return(null);
        }