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 salsa20 import Salsa20_keystream | |
| a_str = Salsa20_keystream(100, "A"*8, 'a'*32) | |
| print a_str.encode('hex') |
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 <gcrypt.h> | |
| int main () { | |
| gcry_error_t gcryError; | |
| gcry_cipher_hd_t gcryCipherHd; | |
| size_t index; | |
| char * salsaKey = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; // 32 bytes | |
| char * iniVector = "AAAAAAAA"; // 8 bytes |
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 <gcrypt.h> | |
| int main (int argc, const char **argv) { | |
| printf("%s\n", gcry_check_version(NULL)); | |
| return 0; | |
| } |
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
| R=IntegerModRing(2**32) | |
| def breaker(rands): | |
| inv_c = [0, -55, 0, 0, 165, 0, 0, -330, 0, 0, 462, 0, 0, -462, 0, 0, 330, 0, 0, -165, 0, 0, 55, 1, 0, -11, -12, 0, 1, 11, 0] | |
| for i in range(2**13): | |
| m2s = Integer(i).digits(base=2, padto=13) | |
| seed = R(0) | |
| index2s = 0 | |
| for i in range(31): | |
| if inv_c[i] != 0: | |
| seed += R((rands[i]*2 + m2s[index2s])*inv_c[i]) |
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
| def pseudo_rand(seed, n): | |
| results = [Integer(seed)] | |
| for i in range(1, 31): | |
| results.append((16807*results[-1]) % 2147483647) | |
| results.append(results[0]) | |
| results.append(results[1]) | |
| results.append(results[2]) | |
| for i in range(34, 344): | |
| results.append((results[-31]+results[-3]) % 2**32) | |
| output = [] |
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
| class VariableGenerator(object): | |
| def __init__(self, prefix): | |
| self.__prefix = prefix | |
| @cached_method | |
| def __getitem__(self, key): | |
| return SR.var("%s%s"%(self.__prefix,key)) | |
| a=VariableGenerator('a') | |
| answers={} |
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 <iostream> | |
| #include <cstdlib> | |
| #include <cstring> | |
| using namespace std; | |
| int main(int argc, char* argv[]){ | |
| long* ptr = new long; | |
| long value = 15; | |
| char user[20]; |
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
| /* University of Deleware Custom Theme Stylesheet | |
| * ----------------------------------------------------------------------------- | |
| * Colors | |
| * ----------------------------------------------------------------------------- | |
| * #00539F Blue | |
| * #FFD200 Yellow | |
| * #bed600 Green - MBA only | |
| */ | |
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 <string.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| void show_chunk_hex(void* start, size_t bytes){ | |
| int i=0; | |
| for(;i<bytes;i+=1){ | |
| printf("%02x", *((unsigned char*) (start+i))); | |
| } | |
| printf("\n"); |
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 <string.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| void show_chunk_hex(void* start, size_t bytes){ | |
| int i=0; | |
| for(;i<bytes;i+=1){ | |
| printf("%02x", *((unsigned char*) (start+i))); | |
| } | |
| printf("\n"); |