Re: tcllib encyption aes compatibility



yahalom <yahalome@xxxxxxxxx> writes:

I will check it deeper but what is strange to me is that you both say
'you must':
1.
AES is a 128-bit block cipher. This means that the data must be provided
in units that are a multiple of 16 bytes.
2.
-key takes a binary string, not a hexdump as input..., so use binary
format to produce what you need there.

but the aes package works without complaining and it encrypts the data
- so it is not a must but a choice. the aes package manages to work ok
with what I supply it. so if it is mistake I should get error.

IMO, the fact you mention reflects poor QOI (Quality Of Implementation)
of the aes package. It should throw an error when the data has not the
correct size, as it does for the key. This or fallback to a documented
padding system, such as the PKCS5/7, which is fairly common.

anyway I will try with the padding. as for binary string how do I
convert the key I supplied to correct binary format?

See [binary format]. However, this should do what you want:

puts [base64::encode [aes::aes \
-key "\x05\x61\xCB\xC3\x21\x6C\x23\xFC\xDC\x6A\x06\x0A\xF8\x29\xAB\x82" \
-mode ecb "hello[string repeat \x0B 11]"]]

but the result does not coincide with your VB test.

--
Oscar
.



Relevant Pages

  • Re: Saving data
    ... > The thing I'm curious about and have no knowledge on is saving data. ... Roll your own binary format. ... Be sure to pick a character encoding and stick ...
    (comp.lang.java.programmer)
  • Re: TCL UDP Extension - need help with getting hex on the wire
    ... hex) as I would using TCP sockets but the data is not sent the same as ... Can someone please let me know how to format the packet ... Just fixed the second problem by replacing the binary format with: ...
    (comp.lang.tcl)
  • Re: how to save time loading data from file
    ... is to store the data on binary format. ... rows per ascii file. ... of the information given in the format. ... And I am a card carrying member of the GOTO society of ...
    (comp.soft-sys.matlab)
  • Re: how to save time loading data from file
    ... is to store the data on binary format. ... rows per ascii file. ... experiments I did with Matlab: ... of the information given in the format. ...
    (comp.soft-sys.matlab)
  • Re: Improving Syslog
    ... other have expressed about complexity, I think that complexity can be ... extended syslog, which among other things, includes a binary log file format ... form) and the ability to have field separators that are not part of the ... I don't think anyone has suggested replacing text with a binary format. ...
    (freebsd-hackers)