Note that there are some explanatory texts on larger screens.

plurals
  1. POSSCrypto/OpenSSL to C# Crypto
    primarykey
    data
    text
    <p>Has anyone been able to use the SSCrypto Framework for Cocoa to encrypt text and then decrypt it in C#/.NET ? Or can someone offer some guidance?</p> <p>I'm pretty sure my issue has to do with getting the crypto settings correct but I am far from fluent in Cocoa so I can't really tell what settings are being used in the library. However my attempt at deciphering it seems like md5 hashing, CBC mode, padding with zeros and I have no idea if the IV is set or not...</p> <p>My C# code looks like this:</p> <pre><code> public static string Decrypt( string toDecrypt, string key, bool useHashing ) { byte[] keyArray; byte[] toEncryptArray = Convert.FromBase64String( toDecrypt ); if( useHashing ) { MD5CryptoServiceProvider hashmd5 = new MD5CryptoServiceProvider(); keyArray = hashmd5.ComputeHash( UTF8Encoding.UTF8.GetBytes( key ) ); hashmd5.Clear(); } else keyArray = UTF8Encoding.UTF8.GetBytes( key ); TripleDESCryptoServiceProvider tdes = new TripleDESCryptoServiceProvider(); tdes.Key = keyArray; tdes.Mode = CipherMode.CBC; tdes.Padding = PaddingMode.Zeros; ICryptoTransform cTransform = tdes.CreateDecryptor(); byte[] resultArray = cTransform.TransformFinalBlock( toEncryptArray, 0, toEncryptArray.Length ); tdes.Clear(); return UTF8Encoding.UTF8.GetString( resultArray ); } </code></pre> <p>When I run encryption on the Cocoa side I get the encrypted text:</p> <p>UMldOZh8sBnHAbfN6E/9KfS1VyWAa7RN</p> <p>but that won't decrypt on the C# side with the same key.</p> <p>Any help is appreciated, thanks.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload