I have a program that has the ability to encrypt files and I want to be able to create a program that can read these files. I believe it uses a Blowfish encryption, but I'm not certain on that. How can I find the type of encryption used and its key?Using Reflector, I was able to find the following code:public static unsafe string Encrypt(string text){    string str;    basic_string<char,std::char_traits<char>,std::allocator<char> > local2;    sbyte modopt(IsSignUnspecifiedByte)* numPtr = (sbyte modopt(IsSignUnspecifiedByte)*) Marshal.StringToHGlobalAnsi(text);    std.basic_string<char,std::char_traits<char>,std::allocator<char> >.{ctor}(&local2, numPtr);    try    {        basic_string<char,std::char_traits<char>,std::allocator<char> > local;        IntPtr hglobal = new IntPtr(numPtr);        Marshal.FreeHGlobal(hglobal);        basic_string<char,std::char_traits<char>,std::allocator<char> >* localPtr = _Encrypt(&local, (basic_string<char,std::char_traits<char>,std::allocator<char> > modopt(IsConst)* modopt(IsImplicitlyDereferenced)) &local2);        try        {            str = new string(std.basic_string<char,std::char_traits<char>,std::allocator<char> >.c_str((basic_string<char,std::char_traits<char>,std::allocator<char> > modopt(IsConst)* modopt(IsConst) modopt(IsConst)) localPtr));        }        fault        {            ___CxxCallUnwindDtor(std.basic_string<char,std::char_traits<char>,std::allocator<char> >.{dtor}, (void*) &local);        }        std.basic_string<char,std::char_traits<char>,std::allocator<char> >.{dtor}(&local);    }    fault    {        ___CxxCallUnwindDtor(std.basic_string<char,std::char_traits<char>,std::allocator<char> >.{dtor}, (void*) &local2);    }    std.basic_string<char,std::char_traits<char>,std::allocator<char> >.{dtor}(&local2);    return str;}I notice it also references this, but I don't understand what it does at all...[PreserveSig, MethodImpl(MethodImplOptions.Unmanaged, MethodCodeType=MethodCodeType.Native), SuppressUnmanagedCodeSecurity]internal static unsafe basic_string<char,std::char_traits<char>,std::allocator<char> >* modreq(IsUdtReturn) modopt(CallConvCdecl) _Encrypt(basic_string<char,std::char_traits<char>,std::allocator<char> >*, basic_string<char,std::char_traits<char>,std::allocator<char> > modopt(IsConst)* modopt(IsImplicitlyDereferenced));I'm still new to desktop programming, my only programming experience is mostly with web-based technologies and the absolute basics of C++. I've never gotten into reverse engineering before either. So please be gentle and thorough in your response as I'd really like to learn.-------------- EDITI've finally been able to find the same function call in OllyDBG. However, setting a breakpoint and making it run the code does not cause it to break.What might I be doing wrong? :/CPU DisasmAddress   Hex dump          Command                            Comments00A088D8  /$  02            ldarg.000A088D9  |.  7B CC000004   ldfld openFileDialog300A088DE  |.  02            ldarg.000A088DF  |.  6F D101000A   callvirt ShowDialog00A088E4  |.  17            ldc.i4.100A088E5  |.- 2E 01         beq.s 0A088E800A088E7  |.  2A            ret00A088E8  |>  02            ldarg.000A088E9  |.  7B CC000004   ldfld openFileDialog300A088EE  |.  6F 8501000A   callvirt get_FileName00A088F3  |.  28 D201000A   call ReadAllText00A088F8  |.  0A            stloc.000A088F9  |.  06            ldloc.000A088FA  |.  6F 9000000A   callvirt Trim00A088FF  |.  6F 3900000A   callvirt get_Length00A08904  |.- 2D 01         brtrue.s 0A0890700A08906  |.  2A            ret00A08907  |>  06            ldloc.000A08908  |.  6F 9000000A   callvirt Trim00A0890D  |.  72 99340070   ldstr ENCRYPTED                  ; UNICODE ENCRYPTED00A08912  |.  6F D301000A   callvirt StartsWith00A08917  |.- 2C 1F         brfalse.s 0A0893800A08919  |.  02            ldarg.000A0891A  |.  72 AD340070   ldstr File is already encrypted  ; UNICODE File is already encrypted00A0891F  |.  28 14000006   call Translate00A08924  |.  72 E1340070   ldstr Error                      ; UNICODE Error00A08929  |.  28 14000006   call Translate00A0892E  |.  16            ldc.i4.000A0892F  |.  1F 10         ldc.i4.s 1000A08931  |.  28 D401000A   call Show00A08936  |.  26            pop00A08937  |.  2A            ret00A08938  |>  06            ldloc.000A08939  |.  28 D501000A   call Encrypt00A0893E  |.  0A            stloc.000A0893F  |.  06            ldloc.000A08940  |.  6F 9000000A   callvirt Trim00A08945  |.  6F 3900000A   callvirt get_Length00A0894A  |.- 2D 01         brtrue.s 0A0894D00A0894C  |.  2A            ret00A0894D  |>  02            ldarg.000A0894E  |.  7B CC000004   ldfld openFileDialog300A08953  |.  6F 8501000A   callvirt get_FileName00A08958  |.  02            ldarg.000A08959  |.  7B CC000004   ldfld openFileDialog300A0895E  |.  6F 8501000A   callvirt get_FileName00A08963  |.  72 ED340070   ldstr .bak                       ; UNICODE .bak00A08968  |.  28 3A00000A   call Concat00A0896D  |.  17            ldc.i4.100A0896E  |.  28 B700000A   call Copy00A08973  |.  02            ldarg.000A08974  |.  7B CC000004   ldfld openFileDialog300A08979  |.  6F 8501000A   callvirt get_FileName00A0897E  |.  06            ldloc.000A0897F  |.  28 A200000A   call WriteAllText00A08984  |.  02            ldarg.000A08985  |.  72 F7340070   ldstr File encrypted             ; UNICODE File encrypted00A0898A  |.  28 14000006   call Translate00A0898F  |.  72 15350070   ldstr Info                       ; UNICODE Info00A08994  |.  28 14000006   call Translate00A08999  |.  16            ldc.i4.000A0899A  |.  1F 40         ldc.i4.s 4000A0899C  |.  28 D401000A   call Show00A089A1  |.  26            pop00A089A2  \.  2A            ret
Reverse Engineering an Encryption Algorithm
encryption;decryption