Questions tagged [cryptography]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
3
votes
3answers
2k 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?
1
vote
1answer
379 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*...
0
votes
0answers
14 views

Does EOS's P2P transmission mechanism support encrypted transmission of information?

I'm not sure if this is already supported. The use case is like this: Using secret-key cryptography, Alice and Bob would have to devise a single cryptographic key that they will both know and use ...
0
votes
1answer
34 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
0answers
21 views

Is it possible to run RSA verification within contract

I am trying to implement RSA signature verification in a contract but am a bit stuck. I implemented RSA signature verification using BigInt, however, because of this, it is not possible to transfer ...
0
votes
0answers
12 views

How to use md5.sum in eos contract

I search nothing about md5 in eosio source code. When i use external md5 lib, i encounter the link error like this 'env._Z7md5sum6NSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE ...
0
votes
0answers
80 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
194 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
304 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
303 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?
3
votes
5answers
678 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 ...
0
votes
1answer
47 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
165 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
416 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 ...
1
vote
0answers
245 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 ...
8
votes
2answers
549 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
162 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 ...
7
votes
2answers
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?
5
votes
1answer
145 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 ...