?
Solved

Maximum length of encoded 20-character string

Posted on 2008-06-15
1
Medium Priority
?
482 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 33

Accepted Solution

by:
Dave Howe earned 2000 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

When ransomware hits your clients, what do you do?

MSPs: Endpoint security isn’t enough to prevent ransomware.
As the impact and severity of crypto ransomware attacks has grown, Webroot has fought back, not just by building a next-gen endpoint solution capable of preventing ransomware attacks but also by being a thought leader.

Question has a verified solution.

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

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
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…
Suggested Courses
Course of the Month9 days, 7 hours left to enroll

762 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