Solved

Maximum length of encoded 20-character string

Posted on 2008-06-15
1
474 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 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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Amazon S3 .Net error 5 43
vb.net convert long time to mm:ss 23 22
I need help adding validation to my MVC.Net view 6 23
Display info from DB to Label in asp.net 7 16
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Businesses who process credit card payments have to adhere to PCI Compliance standards. Here’s why that’s important.
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 …
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 …

733 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