+Tue Nov 6 21:31:54 EET 2001 Pekka Riikonen <priikone@silcnet.org>
+
+ * Added silc_hash_babbleprint to create a Bubble Babble
+ Encoded fingerprint. The encoding is developed by Antti
+ Huima (draft-huima-babble-01.txt), and it creates human
+ readable strings out of binary data. Affected file
+ lib/silccrypt/silchash.[ch].
+
+ * Print the babble print now in addition of fingerprint as well
+ in Irssi SILC client. Affected files are
+ irssi/src/fe-common/silc/module-formats.[ch],
+ irssi/src/fe-common/silc/core/client_ops.c.
+
Sun Nov 4 23:37:28 EET 2001 Pekka Riikonen <priikone@silcnet.org>
* Fixed a security problem found in SKE. The initiator's
{ "key_agreement_failure", "Key agreement failed with {nick $0}", 1, { 0 } },
{ "key_agreement_timeout", "Timeout during key agreement. The key agreement was not performed with {nick $0}", 1, { 0 } },
{ "pubkey_received", "Received {hilight $0} public key", 1, { 0 } },
- { "pubkey_fingerprint", "Fingerprint for the {hilight $0} key is %: $1", 2, { 0, 0 } },
+ { "pubkey_fingerprint", "Fingerprint and babbleprint for the {hilight $0} key are %: $1", 2, { 0, 0 } },
+ { "pubkey_babbleprint", " $0", 1, { 0 } },
{ "pubkey_unsupported", "We don't support {hilight $0} public key type {hilight $1}", 2, { 0, 0 } },
{ "pubkey_discard", "Will not accept the {hilight $0} key", 1, { 0 } },
{ "pubkey_accept", "Would you like to accept the key (y/n)? ", 0 },
SILCTXT_KEY_AGREEMENT_TIMEOUT,
SILCTXT_PUBKEY_RECEIVED,
SILCTXT_PUBKEY_FINGERPRINT,
+ SILCTXT_PUBKEY_BABBLEPRINT,
SILCTXT_PUBKEY_UNSUPPORTED,
SILCTXT_PUBKEY_DISCARD,
SILCTXT_PUBKEY_ACCEPT,
SilcVerifyPublicKey completion, void *context)
{
int i;
- char file[256], filename[256], *fingerprint, *format;
+ char file[256], filename[256], *fingerprint, *babbleprint, *format;
struct passwd *pw;
struct stat st;
char *entity = ((conn_type == SILC_SOCKET_TYPE_SERVER ||
/* Take fingerprint of the public key */
fingerprint = silc_hash_fingerprint(NULL, pk, pk_len);
+ babbleprint = silc_hash_babbleprint(NULL, pk, pk_len);
verify = silc_calloc(1, sizeof(*verify));
verify->client = client;
SILCTXT_PUBKEY_RECEIVED, entity);
printformat_module("fe-common/silc", NULL, NULL, MSGLEVEL_CRAP,
SILCTXT_PUBKEY_FINGERPRINT, entity, fingerprint);
+ printformat_module("fe-common/silc", NULL, NULL, MSGLEVEL_CRAP,
+ SILCTXT_PUBKEY_BABBLEPRINT, babbleprint);
format = format_get_text("fe-common/silc", NULL, NULL, NULL,
SILCTXT_PUBKEY_ACCEPT);
keyboard_entry_redirect((SIGNAL_FUNC)verify_public_key_completion,
SILCTXT_PUBKEY_RECEIVED, entity);
printformat_module("fe-common/silc", NULL, NULL, MSGLEVEL_CRAP,
SILCTXT_PUBKEY_FINGERPRINT, entity, fingerprint);
+ printformat_module("fe-common/silc", NULL, NULL, MSGLEVEL_CRAP,
+ SILCTXT_PUBKEY_BABBLEPRINT, babbleprint);
printformat_module("fe-common/silc", NULL, NULL, MSGLEVEL_CRAP,
SILCTXT_PUBKEY_COULD_NOT_LOAD, entity);
format = format_get_text("fe-common/silc", NULL, NULL, NULL,
SILCTXT_PUBKEY_RECEIVED, entity);
printformat_module("fe-common/silc", NULL, NULL, MSGLEVEL_CRAP,
SILCTXT_PUBKEY_FINGERPRINT, entity, fingerprint);
+ printformat_module("fe-common/silc", NULL, NULL, MSGLEVEL_CRAP,
+ SILCTXT_PUBKEY_BABBLEPRINT, babbleprint);
printformat_module("fe-common/silc", NULL, NULL, MSGLEVEL_CRAP,
SILCTXT_PUBKEY_MALFORMED, entity);
format = format_get_text("fe-common/silc", NULL, NULL, NULL,
SILCTXT_PUBKEY_RECEIVED, entity);
printformat_module("fe-common/silc", NULL, NULL, MSGLEVEL_CRAP,
SILCTXT_PUBKEY_FINGERPRINT, entity, fingerprint);
+ printformat_module("fe-common/silc", NULL, NULL, MSGLEVEL_CRAP,
+ SILCTXT_PUBKEY_BABBLEPRINT, babbleprint);
printformat_module("fe-common/silc", NULL, NULL, MSGLEVEL_CRAP,
SILCTXT_PUBKEY_NO_MATCH, entity);
printformat_module("fe-common/silc", NULL, NULL, MSGLEVEL_CRAP,
{
SilcPublicKey public_key;
SilcPublicKeyIdentifier ident;
- char *fingerprint;
+ char *fingerprint, *babbleprint;
unsigned char *pk;
uint32 pk_len;
SilcPKCS pkcs;
pk = silc_pkcs_public_key_encode(public_key, &pk_len);
fingerprint = silc_hash_fingerprint(NULL, pk, pk_len);
+ babbleprint = silc_hash_babbleprint(NULL, pk, pk_len);
if (silc_pkcs_alloc(public_key->name, &pkcs)) {
key_len = silc_pkcs_public_key_set(pkcs, public_key);
if (ident->country)
printf("Country : %s\n", ident->country);
printf("Fingerprint (SHA1) : %s\n", fingerprint);
+ printf("Babbleprint (SHA1) : %s\n", babbleprint);
fflush(stdout);
return strdup(fingerprint);
}
+
+static const char vo[]= "aeiouy";
+static const char co[]= "bcdfghklmnprstvzx";
+
+/* Creates a babbleprint (Bubble Babble Encoding, developed by Antti
+ Huima (draft-huima-babble-01.txt)), by first computing real fingerprint
+ using `hash' or if NULL, then using SHA1, and then encoding the
+ fingerprint to the babbleprint. */
+
+char *silc_hash_babbleprint(SilcHash hash, const unsigned char *data,
+ uint32 data_len)
+{
+ char *babbleprint;
+ unsigned char hval[32];
+ unsigned int a, b, c, d, e, check;
+ int i, k, out_len;
+
+ if (!hash)
+ silc_hash_alloc("sha1", &hash);
+
+ /* Take fingerprint */
+ silc_hash_make(hash, data, data_len, hval);
+
+ /* Encode babbleprint */
+ out_len = (((hash->hash->hash_len + 1) / 2) + 1) * 6;
+ babbleprint = silc_calloc(out_len, sizeof(*babbleprint));
+ babbleprint[0] = co[16];
+
+ check = 1;
+ for (i = 0, k = 1; i < hash->hash->hash_len - 1; i += 2, k += 6) {
+ a = (((hval[i] >> 6) & 3) + check) % 6;
+ b = (hval[i] >> 2) & 15;
+ c = ((hval[i] & 3) + (check / 6)) % 6;
+ d = (hval[i + 1] >> 4) & 15;
+ e = hval[i + 1] & 15;
+
+ check = ((check * 5) + (hval[i] * 7) + hval[i + 1]) % 36;
+
+ babbleprint[k + 0] = vo[a];
+ babbleprint[k + 1] = co[b];
+ babbleprint[k + 2] = vo[c];
+ babbleprint[k + 3] = co[d];
+ babbleprint[k + 4] = '-';
+ babbleprint[k + 5] = co[e];
+ }
+
+ if ((hash->hash->hash_len % 2) != 0) {
+ a = (((hval[i] >> 6) & 3) + check) % 6;
+ b = (hval[i] >> 2) & 15;
+ c = ((hval[i] & 3) + (check / 6)) % 6;
+ babbleprint[k + 0] = vo[a];
+ babbleprint[k + 1] = co[b];
+ babbleprint[k + 2] = vo[c];
+ } else {
+ a = check % 6;
+ b = 16;
+ c = check / 6;
+ babbleprint[k + 0] = vo[a];
+ babbleprint[k + 1] = co[b];
+ babbleprint[k + 2] = vo[c];
+ }
+ babbleprint[k + 3] = co[16];
+
+ return babbleprint;
+}
uint32 len, unsigned char *return_hash);
char *silc_hash_fingerprint(SilcHash hash, const unsigned char *data,
uint32 data_len);
+char *silc_hash_babbleprint(SilcHash hash, const unsigned char *data,
+ uint32 data_len);
#endif