number theory studies the integers on their own terms — divisibility, primes, remainders — and for two millennia it was the purest of pure mathematics, prized precisely because it was useless. 𐃏 then in 1977 the RSA cryptosystem turned euclid, fermat and euler into load-bearing internet infrastructure. this page walks the classical results in dependency order and ends at that payoff (Epp, Susanna S., 2019).
Cryptography
Caesar
some of the code I’ve written is so stupid I tell you.
this one basically fires up a REPL with a argv[1] as the number of forward caesar cipher steps you want to take.
really not worth running.
#include <stdio.h>
#include <stdlib.h>
int upper(int character, int shift) {
character += shift;
if (character > 90) {
character = (character-90)%26 + 64;
}
else if (character < 65) {
character = (65-character)%26;
if (character == 0) return 65;
character = 91 - character;
}
return character;
}
int lower(int character, int shift) {
character += shift;
if (character > 122) {
character = (character-122)%26 + 96;
}
else if (character < 97) {
character = (97-character)%26;
if (character == 0) return 97;
character = 123 - character;
}
return character;
}
int main(int argc, char* argv[]) {
int shift = atoi(argv[1]);
int character = getchar();
while (character != EOF) {
if (character >= 'A' && character <= 'Z') {
putchar(upper(character, shift));
}
else if (character >= 'a' && character <= 'z') {
putchar(lower(character, shift));
}
else putchar(character);
character = getchar();
}
}
File XOR
#include <stdio.h>
int main(int argc, char *argv[])
{
FILE *fi, *fo;
char *cp;
int c;
if ((cp = argv[1]) && *cp!='\0') {
if ((fi = fopen(argv[2], "rb")) != NULL) {
if ((fo = fopen(argv[3], "wb")) != NULL) {
while ((c = getc(fi)) != EOF) {
if (!*cp) cp = argv[1];
c ^= *(cp++);
putc(c,fo);
}
fclose(fo);
}
fclose(fi);
}
}
}
Here are my distillations of Matt’s seminal blog post: What CS Majors Ought to Know.
I have removed the imperative matter, and left the declarative material; marking off that which I have completed.
What should every student know to get a good job?
What should every student know to maintain lifelong employment?
What should every student know to enter graduate school?
What should every student know to benefit society?
Portfolio versus resume
- Every computer science major should build a portfolio.
- Contributions to open source should be linked and documented.
Technical communication
Specific recommendations
- Master a presentation tool.
Recommended reading
Writing for Computer Science by Zobel.
Backlinks (2)
1. Wiki /wiki/
Knowledge is a paradox. The more one understand, the more one realises the vastness of his ignorance.