Solved

Maximum length of encoded 20-character string

Posted on 2008-06-15
1
457 Views
Last Modified: 2008-06-26
I am using DESCryptoServiceProvider to encrypt strings of various length. The key I'm using is a byte[8] and the iv is a byte[8].
I am wondering what the maximum length of a 20-character string encrypted this way would be?
Or in other words, is there some function that would say what the maximum length of the encryptred string would be for a given string length?

Also, would it be the same if I used DESX instead?

Thanks!
0
Comment
Question by:PapaparaTudu
1 Comment
 
LVL 33

Accepted Solution

by:
Dave Howe earned 500 total points
Comment Utility
ok. you need to include the iv (at one block, or eight bytes), and one eight byte data block per eight bytes of data. 20 is not a multiple of 8, so the next biggest multiple would be 24, giving you 24+8 or 32 bytes. overhead is the 8 byte iv, plus rounding your date up to the next multiple of 8. This will be binary data (regardless of how it started) so you may need to further expand that (using bin64 or similar) if you need it 7 bit clean for email purposes.

desx is xor (key1, des (key 2, xor (key 3, data ) ) )  and has the same block size as straight des - so no further data will be needed. the same is true of 3DES.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Expando 4 33
Hide Tab Page 3 18
Achieve json result 2 24
XML & .net 5 16
Healthcare providers, insurance companies and other covered entities trust eFax Corporate to transmit their most sensitive documents. eFax Corporate can help your organization implement a HIPAA compliant cloud faxing solution.
SSL stands for “Secure Sockets Layer” and an SSL certificate is a critical component to keeping your website safe, secured, and compliant. Any ecommerce website must have an SSL certificate to ensure the safe handling of sensitive information like…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now