Re: Avoiding C++ Templates In Cipher Implementation
From: Russ Lyttle (lyttlec_at_earthlink.net)
Date: 06/08/03
- Next message: Russ Lyttle: "Re: Simple question"
- Previous message: CryptWolf: "Re: anyone has the original SHA-0 specification?"
- In reply to: Mok-Kong Shen: "Re: Avoiding C++ Templates In Cipher Implementation"
- Next in thread: Vedat Hallac: "Re: Avoiding C++ Templates In Cipher Implementation"
- Reply: Vedat Hallac: "Re: Avoiding C++ Templates In Cipher Implementation"
- Reply: Ernst Lippe: "Re: Avoiding C++ Templates In Cipher Implementation"
- Reply: Mok-Kong Shen: "Re: Avoiding C++ Templates In Cipher Implementation"
- Reply: Brian Gladman: "Re: Avoiding C++ Templates In Cipher Implementation"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Sun, 08 Jun 2003 00:15:37 GMT
Mok-Kong Shen wrote:
>
>
> Russ Lyttle wrote:
>>
>
>> The STL is designed to be reused in almost any situation. Common
>> programming aims for ease of understanding and ease of reuse. As such
>> there are lots of idioms and redundancies that aid an attacker. Normal
>> C++ defers as much as possible to runtime. It is not that difficult to
>> take a copy of most machine code and reverse it into understandable
>> source. A template meta-program is in many ways just the opposite. It
>> does one thing well. Everything possible is done at compile time. In my
>> limited experience, it is difficult to understand a meta-program. The
>> machine code is so convoluted that standard reverse engineering tool are
>> useless. I acccept that there is no "security through obscurity". But
>> making it difficult to attach a snoop onto the executiable or making it
>> take a few more days to RE the product, seems worthwhile. To say nothing
>> of the cost savings in using smaller roms and less board space.
>
> You could write anything, code or prose, as difficult
> to understand as you like. Difficulty of understanding
> could also depend on individual psychological factors.
> (Once a school girl said to me that math is unreadable
> and illogical(!).) On the other hand, good programming
> techniques help (if applied appropriately in appropriate
> situations) to develop correct and efficient software
> that can be sufficiently easily verified/validated and
> that's important in general and for crypto programming
> in particular in my conviction.
>
> M. K. Shen
Code I write often must meet some combination of the following 3
requirements. : (1) It must be easy to maintain; (2) It must be proven
correct; or (3) it must be secure. Pick two.
(1) requires readable source and easily debugged execuitables. That means
any one can reverse engineer the object code. Thus less (3).
Templates make it difficult to meet requirement (2) even though they help
lots for meeting (1).
The crypto I do has (3) more important than (2) and often does not have to
meet (1) at all. The crypto algorithm must be correct. The goes-intos must
produce the required goes-outs and not leave any intermediate products
lying around memory or storage. Maintainability is not an issue. If
anything needs fixing, then it is back to the design and source. This is
where template meta-programming seems to help. Template meta-programs run
at compile time. It is very difficult to get a meaningful trace on the
object code. All this means in the end is that Eve might take a week or two
longer to r.e. the code and will find it much more difficult to evesdrop.
The problem isn't to write unmaintainable source, but to write unattackable
object code.
Crypto devices should have lots of anti-tampering mechanisms. This is only
one.
-- Russ Lyttle Not Powered by ActiveX
- Next message: Russ Lyttle: "Re: Simple question"
- Previous message: CryptWolf: "Re: anyone has the original SHA-0 specification?"
- In reply to: Mok-Kong Shen: "Re: Avoiding C++ Templates In Cipher Implementation"
- Next in thread: Vedat Hallac: "Re: Avoiding C++ Templates In Cipher Implementation"
- Reply: Vedat Hallac: "Re: Avoiding C++ Templates In Cipher Implementation"
- Reply: Ernst Lippe: "Re: Avoiding C++ Templates In Cipher Implementation"
- Reply: Mok-Kong Shen: "Re: Avoiding C++ Templates In Cipher Implementation"
- Reply: Brian Gladman: "Re: Avoiding C++ Templates In Cipher Implementation"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|