Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

any samples for this repo? #4

Closed
eaglesharkmayonnaise opened this issue Jun 16, 2019 · 7 comments
Closed

any samples for this repo? #4

eaglesharkmayonnaise opened this issue Jun 16, 2019 · 7 comments

Comments

@eaglesharkmayonnaise
Copy link

  1. Symmetric Cryptography Primitive Functions (AES, SM4, TDES, RC4)
  2. One-Way Hash Primitives (SHA, MD5, SM3)
  3. Data Authentication Primitive Functions (HMAC, CMAC)
  4. Public Key Cryptography Functions (RSA, DLP, ECC)
  5. Finite Field Arithmetic Functions
@eaglesharkmayonnaise
Copy link
Author

ping @yuriynat-int @VasiliyR

@PavelBerdnikOFF
Copy link

Hello, yes we are planning to add samples. You provided a list of ciphers you would like to have samples - thank you. What kind of the samples you would like to have?

@eaglesharkmayonnaise
Copy link
Author

rsa 👍
I have tried porting from the following projects:

  1. SGXDataCenterAttestationPrimitives
  2. keystore
  3. clang_sgx_sdk_v2.5

but Obviously I failed. 😂

@akryeem-INTC
Copy link

You may take a look at: https://github.com/intel/linux-sgx/tree/master/sdk/tlibcrypto
It has crypto operations implemented in both IPP and SgxSSL (OpenSSL APIs). It could help.

Thanks,
Alaa

@eaglesharkmayonnaise
Copy link
Author

eaglesharkmayonnaise commented Jun 16, 2019

@akryeem-INTC
yes i already tried this. and I have modified it and made it simple enough. But I don't know how to pass parameters.
ippctest.zip
password:123.
I hope to have a simpler api, such as:

void rsa_init();

// Of course we can set the length, 2048/3072/4096 etc.
bool get_public_private_key(char* publicKey, char* privateKey);

const char* get_encrypt_buffer(const char* publicKey, const char* Buffer);

const char* get_decrypt_buffer(const char* privateKey, const char* Buffer);

so we can do this:

int main() {
	char buf = "this is message test"
	rsa_init();
	char pubKey[100000];
	char prvKey[100000];
	get_public_private_key(pubKey, prvKey);
	
	auto cipherText = get_encrypt_buffer(pubKey, buf);
	
	auto plaintext = get_decrypt_buffer(prvKey, cipherText);
	
	printf_s("%s\n",plaintext);
}

@amatyuko
Copy link

amatyuko commented Aug 15, 2019

Hi @xoraxrax,

Sorry for the late reply. We're working on examples and plan to publish several of them (including RSA) next week or so. There are plans to extend the functionality that is covered by examples even more later.
Hopefully it is still actual for you.

Regards,
Andrey

@amatyuko
Copy link

Hi @xoraxrax, all,

We have added several examples for RSA and AES, and we plan to add more examples later. Should you have any feedback or suggestions which ones you want to see here first, feel free to ask.

Regards,
Andrey

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants