Solved

Maximum length of encoded 20-character string

Posted on 2008-06-15
1
464 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
ID: 21790289
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Sum Column in GridView 3 41
Anyway to make "All" the default in the dropdown? 6 34
C# HTTP GET method sample code 3 37
Run time Error 4 34
Cybersecurity has become the buzzword of recent years and years to come. The inventions of cloud infrastructure and the Internet of Things has made us question our online safety. Let us explore how cloud- enabled cybersecurity can help us with our b…
Explore the encryption capabilities built into Google Apps and how these features can help you meet privacy policy and regulatory compliance, but are not a full solution. Understand and compare the most popular email encryption services for Google A…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

932 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

13 Experts available now in Live!

Get 1:1 Help Now