Questions tagged [cryptography]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
6 views

EOSIOSwiftVault - “Key generation failed.” How to generate keyPairs?

Following the tutorial in https://github.com/EOSIO/eosio-swift-vault for EosioSwiftVault I wrote the following function: import EosioSwiftVault func getKeyPair() let vault = EosioVault(accessGroup: ...
0
votes
2answers
56 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
1answer
72 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) ...
1
vote
2answers
61 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
0answers
18 views

Is it possible to encrypt a message with someone public key and decrypt with only his private key? [duplicate]

This one uses the sender's private key and recipient public key: https://github.com/EOS-Nation/eos-encrypt/blob/master/examples/encrypt-multiple-keys.ts Is it even possible to do the same but with ...
0
votes
1answer
36 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
1answer
112 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
1answer
197 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
2answers
426 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 ...
1
vote
0answers
231 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
1answer
312 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*...
1
vote
0answers
145 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 ...
6
votes
2answers
896 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?
3
votes
5answers
582 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 ...
5
votes
1answer
131 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 ...
3
votes
2answers
1k 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?