RE: CryptEncrypt question
- From: Al <Al@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 20 Feb 2008 10:51:03 -0800
Actually, that is not what I meant. The input is not an issue. The issue for
me is the output. It used characters like '\0xa\, '\0xd' etc. in the output.
Now again, that maybe how it is supposed to work. The problem for me is since
I use the generated output as part of another concatenated string and in turn
use tokens like '\0xd', it throws token processing off.
So again, if there is no way to prevent CryptEncrypt from generating certain
output characters, is there any safe characters I can use as a token at all?
Thanks.
"lelteto" wrote:
CryptEncrypt is (and should always be) "blind" for any "character". It works.
on BINARY data, ie. any input byte can have any value (0 - 255 = 0x00 -
0xff). You cannot "ask" a CSP to "skip" certain characters.
Another issue is block encryption: In such case each of your lines would be
extended for full block size (and to know the length you would need padding
as well.)
Moreover, you cannot make sure encryption will not result in some more
"extra" characters. So even if you encrypt line by line you would get some
more "special" characters in the ciphertext.
All in all, encryption will not preserve any formatting (like line splitss,
Tab chars, etc). If you need that, you would have to create your own
"obfuscation" of your text line by line. Note, however, that this will almost
surely decrease the security - probably seriously. So unless your goal is
just to do some CASUAL obfuscation against the simplest users, you better NOT
try to go around proper cryptography (ie. CryptEncrypt).
Laszlo Elteto
SafeNet, Inc.
"Al" wrote:
I have used CryptEncrypt fine so far until I hit a issue recently. I am using
some tags such as '\n' and '\t' in order to tokenize a few strings. It turns
out that CryptEncrypt ofcourse can use these when encrypting. When that
happens, it obviously messes up things for me. I have a 2 part question:
1. Is there a way to tell the underlying CSP not to use some characters when
using the Crypto API's like CryptEncrypt?
2. What would be a few safe characters to use to tokenize which are
guaranteed not to be used by CryptEncrypt?
Thanks.
- Follow-Ups:
- Re: CryptEncrypt question
- From: Kalle Olavi Niemitalo
- Re: CryptEncrypt question
- Prev by Date: RE: CreateFile() and Limited User
- Next by Date: Re: CryptEncrypt question
- Previous by thread: RE: Elevate permission of code
- Next by thread: Re: CryptEncrypt question
- Index(es):
Relevant Pages
|