Questions tagged [cryptography]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
7 views

When you query on a secondary index, are you provided with a cryptographic proof?

EOS newbie here. Thanks for any insight. If you can point me towards more info, great.
  • 1
0 votes
1 answer
86 views

Trouble using EOSIO built in crypto library (can't resolve headers)

I ran eosio-init on the newest CDT (1.7) and made a -bare project. newtest.cpp #include "newtest.hpp" ACTION newtest::hi( name nm ) { /* fill in action body */ print_f("Name : %\n",nm); } ...
0 votes
2 answers
395 views

Do SHA256 with CDT 1.6

I have a problem, when I was in the 1.3 version of eosio.CDT I successfully reproduce the same SHA256 in my contract and with multiple external method. It work like the dice contract. You generate in ...
0 votes
1 answer
738 views

Why are the EOS private key/public key both 33-byte(compress mode)?

Read from some document about EOS key recovery method: Start from standard EOS address (53byte), for exp: EOS+(50byte base58); decode (50byte base58) to get 37byte (hex); remove last 4byte (checksum) ...
  • 35
1 vote
2 answers
773 views

Which encryption algorithm EOSIO uses [duplicate]

As we know Ethereum uses ECDSA (Elliptic Curve Digital Signature Algorithm) for its public-key cryptography. Which algorithm EOS uses for encryption?
0 votes
1 answer
79 views

Is there any API in EOS Smart Contract to decrypt message? [duplicate]

I would like to create a smart contract that would be able to decrypt some symmetrically encrypted message. Here is the scenario: Party "A" sends a message encrypted with key "123456" to ...
1 vote
1 answer
231 views

eosjs ecc sha256 produce different hash than the EOS cpp sha256

I should compare two hashes and the scenario is the following: I create a new record in the contract as I pass eosjs-ecc sha256 generated hash as string. Let name it hashA. When I want to update the ...
2 votes
1 answer
581 views

How reproduce sha256 in Javascript?

I actually use an implementation like the dice contract : https://github.com/EOSIO/eos/tree/v1.2.0/contracts/dice You create a key and his hash with sha256, you first send the hash and then the key ...
8 votes
2 answers
802 views

Encrypting with a public key

I have user specific data in a table on my smart contract that I don't want others to see. Can I encrypt that data with a public key of the user? If possible then how to encrypt that data with the ...
  • 103
1 vote
0 answers
272 views

Using recover_key with eosjs

I want to validate user signatures in my smart contract. As I understood, I am supposed to do that with recover_key function from crypto.h I am using JavaScript with eosjs and eosjs-ecc for ...
1 vote
1 answer
476 views

How to use recover function in crypto.hpp to verify signature and public key

I want to sign some data in client using eosjs-ecc.sign() and result is a string like "SIG_K1_KcTmv..." I want to use the recover_key(const checksum256* digest, const char* sig, size_t siglen, char*...
  • 221
1 vote
0 answers
186 views

how to convert eosio::public_key to c public_key?

In the vote.cpp, they use this type of public key: namespace eosio { struct public_key { unsigned_int type; std::array<char,33> data; friend bool operator == ( const ...
  • 1,066
8 votes
2 answers
1k views

What block hash function and transaction signature method does EOS use?

What hash function does EOS use for creating a block. Is it SHA-256? In addition, what procedure for signing a transaction is used? RSA?
  • 203
3 votes
5 answers
757 views

Cryptographic Operations in Smart Contracts?

Is it possible to perform cryptographic operations inside a smart contract? I'm specifically thinking about simple hashing (SHA-1/256/3) and symmetric encryption (AES). Obviously, handling key ...
  • 1,824
5 votes
1 answer
156 views

Is the block digest c++ specific?

I'm not sure how to write this block header digest/hash generation in another language then C(++). Is this even possible without a lot of hacking? If so: Could a language-neutral format for the ...
  • 303
5 votes
3 answers
3k views

What are the formats for the pub key/priv key/signatures?

How are the public key, private key and the signature decoded to the actual ecc keys? How many bytes are these decoded keys?
  • 303