0

I know this is a withdrawn standard. Nevertheless, the customer wants it (and we know who's always right). So, how do I do it? Ho can I choose ISO 10126 padding for an AES128 encryption?

Edit: The LB version in use is 3.4.1 (I didn't have the time/knowledge to fix the latest release to run with XE2)

Sherlock70
  • 564
  • 10
  • 24
  • Does the version that you use have support for this standard? – David Heffernan Oct 17 '14 at 07:57
  • @DavidHeffernan well, it's not built in. On the other hand I can't select any padding at all with AES-128, soo...I guess I'm screwed, huh? Meaning I'll have to choose a different crypting component. Just when I began to like TPLB...*sigh* – Sherlock70 Oct 17 '14 at 08:01
  • 1
    All you need to do is add some random padding bytes at the end. It should be very easy to implement that. However, as I understand it ISO 10126 applies to DEA/DES but you are using AES128. So I wonder whether you might change the expectations of the client. – David Heffernan Oct 17 '14 at 08:05
  • That's what I'm reading now too, strange. But in other articles such as [Wikipedia on CBC](http://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Cipher-block_chaining_.28CBC.29) padding is possible in many ways. By the way this is for communicating with a government resource so it is their specs that others have followed as well, so it should be possible. Specs: "AES(128)/CBC/ISO10126Padding" – Sherlock70 Oct 17 '14 at 08:09
  • IMO the only reason to support ISO 10126 padding is decryption problem: you have data encrypted with ISO 10126 padding (by some 3rd party soft), and you need to decrypt it. If the customer wants ISO 10126 encryption he probably don't understand what he wants. – kludg Oct 17 '14 at 13:17
  • 1
    BTW a cryptosystem with ISO 10256 padding is not chosen-ciphertext secure; makes me wonder why "a goverment resource" insists on using it. :) – kludg Oct 17 '14 at 14:02
  • Austrians...they are...peculiar to say the least ;) – Sherlock70 Oct 20 '14 at 06:08

1 Answers1

1

(1) You can roll your own padding. If you roll your own padding to make the message size an exact multiple of block cipher, TPLB3 will not try to add any additional padding.

(2) For most chaining modes, TPLB3 will automatically add salt. This is normally a good thing, but if you need it without, you can remove the option for it.

(3) I maintain version 3.5.0, which you can find here

http://lockbox.seanbdurkin.id.au/Grok+TurboPower+LockBox

Compared to 3.4.1, the unit names have changed a lot, but the code has not.

(4) If you need a working example, please post your KAT.

Sean B. Durkin
  • 12,659
  • 1
  • 36
  • 65
  • Thanks, I'll give that a go. On a sidenote, can I read a public key from a X509 Certifiate with TPLB? – Sherlock70 Oct 21 '14 at 08:32
  • @Sherlock70 About X509: No, sorry (in relation to TCodec). The core of TPLB3 does not support X509, however there are the TOpenSSL_Signatory and TOpenSSL_Codec components. These components are a wrapper around OpenSSL and require libeay32.dll or libeay64.dll. The signatory component can load a subtype of X509. These are PEM (SSLeay) formatted keys produced by OpenSSL with envelope -----BEGIN/END RSA PRIVATE KEY----- . Note that PEM (PKCS#8) is not supported, but it could be with some small modification. – Sean B. Durkin Oct 22 '14 at 02:45