Re: How good an encryption algorithm is this?
From: Severian (severian_at_chlamydia-is-not-a-flower.com)
Date: 11/22/04
- Next message: Willy Denoyette [MVP]: "Re: How to use GetObject in CShaprt"
- Previous message: Bob Powell [MVP]: "Re: DrawReversible"
- In reply to: Nicholas Paldino [.NET/C# MVP]: "Re: How good an encryption algorithm is this?"
- Next in thread: Carl Daniel [VC++ MVP]: "Re: How good an encryption algorithm is this?"
- Reply: Carl Daniel [VC++ MVP]: "Re: How good an encryption algorithm is this?"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 22 Nov 2004 17:33:02 -0500
On Mon, 22 Nov 2004 15:02:33 -0500, "Nicholas Paldino [.NET/C# MVP]"
<mvp@spam.guard.caspershouse.com> wrote:
>Bonj,
>
> See inline:
>
>> 1) Must be capable of encrypting strings to a byte array, and decyrpting
>> back again to the same string
>
> All encryption algorithms do this. If you couldn't decrypt back, then
>it would be a hash.
>
>> 2) Must have the same algorithm work with strings that may or may not be
>> unicode
>
> This should not be an issue. Encryption works on byte streams, not
>strings. As long as the string can be converted to/from a byte stream, you
>won't have a problem.
>
>> 3) Number of bytes back must either be <= number of _TCHARs in *
>> sizeof(_TCHAR), or the relation between output size and input size can be
>> calculated simply. Has to take into account the null terminator on the end
>> of the string.
>
> The null terminator at the end of a string is just another byte. If you
>encrypt it, it's going to take up space. If you don't need it, don't use it
>then. As for the output size, I believe that it is the same as the input
>size.
>
>> 4) Encryption algorithm must also return the exact number of bytes of the
>> encrypted data
>
> Do you mean that it will return the number of bytes it would take to
>encrypt the data? Since most algorithms return the same size, this won't be
>a problem.
>
> I would recommend against rolling your encryption. Rather, you should
>use one of the classes in the System.Security.Cryptography namespace. If
>you need compression as well, then you can apply that after the encryption.
I agree with the first two sentences, but compression should be done
before encryption, since encrypted data does not usually compress
well.
-- Sev
- Next message: Willy Denoyette [MVP]: "Re: How to use GetObject in CShaprt"
- Previous message: Bob Powell [MVP]: "Re: DrawReversible"
- In reply to: Nicholas Paldino [.NET/C# MVP]: "Re: How good an encryption algorithm is this?"
- Next in thread: Carl Daniel [VC++ MVP]: "Re: How good an encryption algorithm is this?"
- Reply: Carl Daniel [VC++ MVP]: "Re: How good an encryption algorithm is this?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|