473,320 Members | 1,828 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Question regarding ICryptoTransform resuability

Can someone explain the CanResuseTransform property of this interface to me?

I have an app that communicates over the network and I encrypt the
individual UDP packets which are sent and received from multiple clients.
Each has the same key and IV.

I guess my question is, do I need to create new encryptors and decryptors
for every packet?

Part of my concern is that the state of the encryptor/decryptor might change
as packets are encrypted. If that's the case, then if I encrypt a packet and
send it to client A and then encrypt an identical packet for client B, the
two packets will be different and only the first recipient will be able to
decrypt it.

I use the CryptoStream.FlushFinalBlock, so I'm assuming this resets the
states and will allow me to do what I want. I'd like to avoid the cost of
recreating the encryptor and decryptor for every packet.

Thanks.
Dec 30 '07 #1
2 2391
Fredo wrote:
Can someone explain the CanResuseTransform property of this interface to me?

I have an app that communicates over the network and I encrypt the
individual UDP packets which are sent and received from multiple clients.
Each has the same key and IV.

I guess my question is, do I need to create new encryptors and decryptors
for every packet?

Part of my concern is that the state of the encryptor/decryptor might change
as packets are encrypted. If that's the case, then if I encrypt a packet and
send it to client A and then encrypt an identical packet for client B, the
two packets will be different and only the first recipient will be able to
decrypt it.

I use the CryptoStream.FlushFinalBlock, so I'm assuming this resets the
states and will allow me to do what I want. I'd like to avoid the cost of
recreating the encryptor and decryptor for every packet.

Thanks.
The CanReuseTransform property tells you exactly that. If it returns
true, you can reuse the transform.

--
Göran Andersson
_____
http://www.guffa.com
Dec 30 '07 #2
"Göran Andersson" <gu***@guffa.comwrote in message
news:eR*************@TK2MSFTNGP06.phx.gbl...
Fredo wrote:
>Can someone explain the CanResuseTransform property of this interface to
me?

I have an app that communicates over the network and I encrypt the
individual UDP packets which are sent and received from multiple clients.
Each has the same key and IV.

I guess my question is, do I need to create new encryptors and decryptors
for every packet?

Part of my concern is that the state of the encryptor/decryptor might
change as packets are encrypted. If that's the case, then if I encrypt a
packet and send it to client A and then encrypt an identical packet for
client B, the two packets will be different and only the first recipient
will be able to decrypt it.

I use the CryptoStream.FlushFinalBlock, so I'm assuming this resets the
states and will allow me to do what I want. I'd like to avoid the cost of
recreating the encryptor and decryptor for every packet.

Thanks.

The CanReuseTransform property tells you exactly that. If it returns true,
you can reuse the transform.

Okay, that's what I suspected. Thanks.
Dec 30 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jo_Calico | last post by:
I love the Dynamic Drive cross browser marquee script. I'd like to make the text loop immediately after completion, so the beginning runs right after the end (does that make sense?). Could anyone...
1
by: CLEAR-RCIC | last post by:
We have some .dlls that we have written that use config files to store configuration information such as usernames and passwords. In a previous posting I asked for some suggestions for encrypting...
5
by: Patrick De Ridder | last post by:
The following code produces an error on the very last line, namely: An unhandled exception of type 'System.Security.Cryptography.CryptographicException' occurred in mscorlib.dll Additional...
6
by: rodchar | last post by:
Hey all, I'm trying to understand Master/Detail concepts in VB.NET. If I do a data adapter fill for both customer and orders from Northwind where should that dataset live? What client is...
4
by: Tiraman | last post by:
Hi , can some one explain me what does it mean those 2 params that i need to pass the des.CreateEncryptor(rgbKey as byte,rgbIV as byte) Best Regards , Tiraman :-)
3
by: Debbie Carter | last post by:
Can XML files be easily encrypted?
6
by: Jon | last post by:
All, I'm working in a fairly robust content management system for our company's websites, and have a question regarding the file and directory structure of the site. Currently, I'm populating...
2
by: Mark | last post by:
I have been playing around with encrypting passwords using a class found in a MS KB (see farther down). It seems to work great so long as the original password is comprised of characters on the...
6
by: SenseiHitokiri | last post by:
I have some code that converts a string into base64 for some encryption. It was written on the 1.1 framework but I am trying to get it to work on 2.0. It throws exceptions on the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.