title: Can I treat CryptoStream as a replacement for SslStream?
body: <p>I need to send data between SilverLight applications. I've got requirement that says that data should be transmitted using secure protocol such as SSL/TLS. Data is sent using TCP sockets due to performance reasons. Unfortunately SilverLight doesn't support <a href="http://msdn.microsoft.com/en-us/library/system.net.security.sslstream.aspx" rel="nofollow">SslStream</a>. If I want to transmit data over SSL/TLS I need to buy third party library e.g. <a href="http://www.eldos.com/sbb/" rel="nofollow">SecureBlackbox</a>. I don't want to be dependent on third party libraries when it comes to handling transport layer.</p>
  
  <p>However, SilverLight has <a href="http://msdn.microsoft.com/en-us/library/system.security.cryptography.cryptostream.aspx" rel="nofollow">CryptoStream</a> class. I'm thinking of exchanging the key for symmetric encryption using WCF over SSL (SilverLight supports that) and then encrypt the data with AES using CryptoStream.</p>
  
  <p>Is this solution safe? Can it be compared to using SSL/TLS in terms of security? Is there some obvious security hole that I'm missing?</p>