keybase / python-triplesec

A Python port of the triplesec library.
BSD 3-Clause "New" or "Revised" License
82 stars 18 forks source link

Key and plaintext data types #1

Closed FiloSottile closed 11 years ago

FiloSottile commented 11 years ago

@maxtaco

Should plaintext and key be binary or Unicode?

Most crypto libraries will leave encoding to the lib user, so only accept binary. However if we only deal with passwords we might want to take care of encoding of the key, but not really sure that it would be a good idea.

maxtaco commented 11 years ago

What exactly is the context? Probably the key is unicode and the plaintext is binary (since it's going to be key material from RSA, etc).

FiloSottile commented 11 years ago

The generic TripleSec library encrypt() and decrypt()

FiloSottile commented 11 years ago

I'm wondering if the key can happen to be binary data. Actually if we want TripleSec to be reusable, we should account for this occurrence.

maxtaco commented 11 years ago

Yeah, I agree. Binary for everything. If you have a utf8-key, it's on you to encode it as binary data first.

FiloSottile commented 11 years ago

:thumbsup: