This file contains hidden or 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
| from Crypto.PublicKey import RSA | |
| from Crypto.Cipher import PKCS1_OAEP | |
| #from Crypto.Cipher import PKCS1_v1_5 | |
| from Crypto.Cipher import AES | |
| from Crypto import Random | |
| # Encrypting Side | |
| plaintext1 = 'd683a86a-69c8-4c1f-8442-8a88208f4009.226287546443-fs1vpkb275ud6i4rcsk6vjajcaua1kb5' | |
| print 'plaintext1:',plaintext1 | |
| key1 = Random.new().read(16) |
This file contains hidden or 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
| #include <stdio.h> | |
| #include <string.h> | |
| size_t slen(char *s); | |
| void scpy(char *s, char *t); | |
| int scmp(char *s, char *t); | |
| const int STR_MAX_SIZE = 10; | |
| int main() |
This file contains hidden or 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
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #define MAXLINE 1024 | |
| int mygetline(char *s, int lim); | |
| int main() | |
| { |
This file contains hidden or 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
| #include <stdio.h> | |
| #include <string.h> | |
| int main() | |
| { | |
| char *s1 = "cdefghijklmnopqrstuvwxy"; | |
| char *s2 = "abxyz"; | |
| char array[256]; |
This file contains hidden or 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
| import sys | |
| def bitsoncount(i): | |
| assert 0 <= i < 0x100000000 | |
| i = i - ((i >> 1) & 0x55555555) | |
| i = (i & 0x33333333) + ((i >> 2) & 0x33333333) | |
| return (((i + (i >> 4) & 0xF0F0F0F) * 0x1010101) & 0xffffffff) >> 24 | |
| if len(sys.argv) < 2: |