Tink 1.2.0-rc2 released

46 views
Skip to first unread message

Charles Lee II

unread,
Jul 14, 2018, 3:58:28 AM7/14/18
to tink-...@googlegroups.com
Tink 1.2.0-rc2 was released 2018-07-13.

Sreejith Krishnan R

unread,
Jul 17, 2018, 2:05:09 AM7/17/18
to tink-users
Thanks for developing this awesome crypto library.

In C++ / Obj C, key generation for hybrid encryption and digital signature is not implemented.

Will it be supported before 1.2.0 final release?

⛷ Thai Duong

unread,
Jul 17, 2018, 1:00:53 PM7/17/18
to sreejith....@gmail.com, tink-users
On Mon, Jul 16, 2018 at 11:05 PM Sreejith Krishnan R <sreejith....@gmail.com> wrote:
Thanks for developing this awesome crypto library.

In C++ / Obj C, key generation for hybrid encryption and digital signature is not implemented.

Will it be supported before 1.2.0 final release?


On Saturday, July 14, 2018 at 1:28:28 PM UTC+5:30, Charles Lee II wrote:
Tink 1.2.0-rc2 was released 2018-07-13.

--
You received this message because you are subscribed to the Google Groups "tink-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tink-users+...@googlegroups.com.
To post to this group, send email to tink-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tink-users/614a6e5d-dd13-4b25-be90-2f10f392593a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--

Sreejith Krishnan R

unread,
Jul 18, 2018, 2:15:08 AM7/18/18
to tink-users
Thanks for reply.

#include "tink/config/tink_config.h"
#include "tink/hybrid_key_templates.h"
#include "tink/keyset_handle.h"

using namespace crypto::tink;

int main() {
auto status = TinkConfig::Register();
if (!status.ok()) {
std::cout << status.ToString() << std::endl;
exit(1);
}

auto new_keyset_handle_result = KeysetHandle::GenerateNew(HybridKeyTemplates::EciesP256HkdfHmacSha256Aes128Gcm());
if (!new_keyset_handle_result.ok()) {
std::cout << new_keyset_handle_result.status().ToString() << std::endl;
exit(1);
}

auto keyset_handle = std::move(new_keyset_handle_result.ValueOrDie());
}

Running above code fails with status UNIMPLEMENTED: not implemented yet

Source code reference:-

⛷ Thai Duong

unread,
Jul 18, 2018, 3:42:41 AM7/18/18
to Sreejith Krishnan R, Bartosz Przydatek, tink-users
Oh you're right. We'll implement it and release RC3.


For more options, visit https://groups.google.com/d/optout.


--

Sreejith Krishnan R

unread,
Jul 18, 2018, 11:49:16 PM7/18/18
to tink-users
Thank you.

⛷ Thai Duong

unread,
Jul 20, 2018, 11:12:48 AM7/20/18
to Sreejith Krishnan R, tink-users
Hi Sreejith,

This should be fixed in master. Can you try again? If it works, we'll release 1.2.0-RC3.


For more options, visit https://groups.google.com/d/optout.


--

Sreejith Krishnan R

unread,
Jul 21, 2018, 9:32:59 AM7/21/18
to tink-users
Hi Thai,

Thanks for update. Key generation works now.

Just one suggestion. It is little bit complicated to get the public keyset from private keyset. See sample code below for generating public and private keyset for hybrid encryption in c++.

auto private_keyset_handle = std::move(crypto::tink::KeysetHandle::GenerateNew(
crypto::tink::HybridKeyTemplates::EciesP256HkdfHmacSha256Aes128Gcm()).ValueOrDie());

auto private_keyset = crypto::tink::CleartextKeysetHandle::GetKeyset(*private_keyset_handle);

auto public_keyset = google::crypto::tink::Keyset();
public_keyset.set_primary_key_id(private_keyset.primary_key_id());

for (int i=0; i<private_keyset.key_size(); i++) {
auto private_key = google::crypto::tink::EciesAeadHkdfPrivateKey();
private_key.ParseFromString(private_keyset.key(i).key_data().value());

public_keyset.add_key();
auto public_key = public_keyset.mutable_key(i);

public_key->MergeFrom(private_keyset.key(i));
public_key->mutable_key_data()->set_value(private_key.public_key().SerializeAsString());
public_key->mutable_key_data()->set_key_material_type(
google::crypto::tink::KeyData_KeyMaterialType::KeyData_KeyMaterialType_ASYMMETRIC_PUBLIC);
public_key->mutable_key_data()->set_type_url(crypto::tink::EciesAeadHkdfPublicKeyManager::kKeyType);
}

auto public_keyset_handle = crypto::tink::KeysetUtil::GetKeysetHandle(public_keyset);


It would be useful to have an API similar to Java.

KeysetHandle privateKeysetHandle = KeysetHandle.generateNew(HybridKeyTemplates.ECIES_P256_HKDF_HMAC_SHA256_AES128_GCM);
KeysetHandle publicKeysetHandle = privateKeysetHandle.getPublicKeysetHandle();


Apart from this key generation for hybrid encryption and digital signature is now working.

⛷ Thai Duong

unread,
Jul 21, 2018, 12:50:54 PM7/21/18
to Sreejith Krishnan R, tink-users
On Sat, Jul 21, 2018 at 6:33 AM Sreejith Krishnan R <sreejith....@gmail.com> wrote:
Hi Thai,

Thanks for update. Key generation works now.

Just one suggestion. It is little bit complicated to get the public keyset from private keyset. See sample code below for generating public and private keyset for hybrid encryption in c++.

auto private_keyset_handle = std::move(crypto::tink::KeysetHandle::GenerateNew(
crypto::tink::HybridKeyTemplates::EciesP256HkdfHmacSha256Aes128Gcm()).ValueOrDie());

auto private_keyset = crypto::tink::CleartextKeysetHandle::GetKeyset(*private_keyset_handle);

auto public_keyset = google::crypto::tink::Keyset();
public_keyset.set_primary_key_id(private_keyset.primary_key_id());

for (int i=0; i<private_keyset.key_size(); i++) {
auto private_key = google::crypto::tink::EciesAeadHkdfPrivateKey();
private_key.ParseFromString(private_keyset.key(i).key_data().value());

public_keyset.add_key();
auto public_key = public_keyset.mutable_key(i);

public_key->MergeFrom(private_keyset.key(i));
public_key->mutable_key_data()->set_value(private_key.public_key().SerializeAsString());
public_key->mutable_key_data()->set_key_material_type(
google::crypto::tink::KeyData_KeyMaterialType::KeyData_KeyMaterialType_ASYMMETRIC_PUBLIC);
public_key->mutable_key_data()->set_type_url(crypto::tink::EciesAeadHkdfPublicKeyManager::kKeyType);
}

auto public_keyset_handle = crypto::tink::KeysetUtil::GetKeysetHandle(public_keyset);


It would be useful to have an API similar to Java.

KeysetHandle privateKeysetHandle = KeysetHandle.generateNew(HybridKeyTemplates.ECIES_P256_HKDF_HMAC_SHA256_AES128_GCM);
KeysetHandle publicKeysetHandle = privateKeysetHandle.getPublicKeysetHandle();

Definitely. We'll fix this early next week.

For more options, visit https://groups.google.com/d/optout.

Sreejith Krishnan R

unread,
Jul 23, 2018, 1:34:18 AM7/23/18
to tink-users
Thank you.

⛷ Thai Duong

unread,
Jul 27, 2018, 8:05:27 PM7/27/18
to Sreejith Krishnan R, tink-users
Hi Sreejith,

We just released RC3 which includes the key generation API (C++ and Obj-C) and getKeysetHandle API (C++ only, Obj-C needs to wait till RC4).

Please tell us if you encounter any other issues.

Thanks!


For more options, visit https://groups.google.com/d/optout.


--

Sreejith Krishnan R

unread,
Jul 28, 2018, 5:15:11 AM7/28/18
to tink-users
Thank you Thai.
Reply all
Reply to author
Forward
0 new messages