Last active
November 1, 2018 17:51
-
-
Save Grrrben/5de0b636c6de138555209292407d5136 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func TestPublicKeyExample(t *testing.T) { | |
henk, _ := NewRsaIdentity() | |
ingrid, _ := NewRsaIdentity() | |
msg := []byte("Negenennegentig procent van de problemen in de wereld worden veroorzaakt door buitenlanders.") | |
// Lets encrypt it, we want to sent it to Ingrid, thus, we use her public key. | |
encryptedMessage, _ := henk.Encrypt(msg, ingrid.public) | |
fmt.Printf("%s\n", msg) | |
// Negenennegentig procent van de problemen in de wereld worden veroorzaakt door buitenlanders. �zmNOOe@{��}9������#-��^� ����Jh��l0����c2S���a>�AA/�z�2��*c�@^w�P�Xu�HK���hu_u̴Jsi���7 | |
fmt.Printf("%s\n", encryptedMessage) | |
// zmNOOe@{��}9������#-��^� ����Jh��l0����c2S���a>�AA/�z�2��*c�@^w�P�Xu�HK���hu_u̴Jsi���7 | |
// �w�n��Z,2��w��a���W*G3��'ZR� | |
// *�4��� ��Q�M | |
// Ԓ┴L�H[)�@�≥���������>�⎽��VW�≥#��/P%�C���F | |
// ���@��F·┴�C�%�OҎ�≤B���◆8�@�┴EL��� ��������J─ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment