diff --git a/35mm_film_canister/instructions.odt b/35mm_film_canister/instructions.odt new file mode 100644 index 0000000..b305f57 Binary files /dev/null and b/35mm_film_canister/instructions.odt differ diff --git a/Go/one-time-pad-utils b/Go/one-time-pad-utils new file mode 100755 index 0000000..6ea9ba6 Binary files /dev/null and b/Go/one-time-pad-utils differ diff --git a/Go/otp_decrypt/otp_decrypt.go b/Go/otp_decrypt/otp_decrypt.go index 99beb5d..8f6f082 100644 --- a/Go/otp_decrypt/otp_decrypt.go +++ b/Go/otp_decrypt/otp_decrypt.go @@ -18,16 +18,16 @@ func OTPDecrypt(message string, key string) string { for n, c := range paddefinitions.NumToCharMap{ if c == strings.ToUpper(char) { messagesplitint = append(messagesplitint, n) - + } } } - + for _, char := range keysplit { for n, c := range paddefinitions.NumToCharMap{ if c == strings.ToUpper(char) { keysplitint = append(keysplitint, n) - + } } } @@ -39,7 +39,7 @@ func OTPDecrypt(message string, key string) string { var decryptedmessage []string for pos, messagenum := range messagesplitint{ - decryptedmessage = append(decryptedmessage, paddefinitions.NumToCharMap[(((messagenum - keysplitint[pos]) % 35) + 35) % 35]) // crazy modulo for decryption + decryptedmessage = append(decryptedmessage, paddefinitions.NumToCharMap[(((messagenum - keysplitint[pos]) % 36) + 36) % 36]) // crazy modulo for decryption } diff --git a/Go/otp_encrypt/otp_encrypt.go b/Go/otp_encrypt/otp_encrypt.go index ad1e63e..246e055 100644 --- a/Go/otp_encrypt/otp_encrypt.go +++ b/Go/otp_encrypt/otp_encrypt.go @@ -18,16 +18,16 @@ func OTPEncrypt(message string, key string) string { for n, c := range paddefinitions.NumToCharMap{ if c == strings.ToUpper(char) { messagesplitint = append(messagesplitint, n) - + } } } - + for _, char := range keysplit { for n, c := range paddefinitions.NumToCharMap{ if c == strings.ToUpper(char) { keysplitint = append(keysplitint, n) - + } } } @@ -42,7 +42,7 @@ func OTPEncrypt(message string, key string) string { if pos != 0 && pos % 5 == 0 { encryptedmessage = append(encryptedmessage, " ") } - encryptedmessage = append(encryptedmessage, paddefinitions.NumToCharMap[(messagenum + keysplitint[pos]) % 35]) + encryptedmessage = append(encryptedmessage, paddefinitions.NumToCharMap[(messagenum + keysplitint[pos]) % 36]) } return (strings.Join(encryptedmessage, "")) diff --git a/Go/pad_definitions/pad_definitions.go b/Go/pad_definitions/pad_definitions.go index 48298b2..4e79594 100644 --- a/Go/pad_definitions/pad_definitions.go +++ b/Go/pad_definitions/pad_definitions.go @@ -1,40 +1,40 @@ package paddefinitions var NumToCharMap = map[int]string{ - 0: "9", - 1: "A", - 2: "B", - 3: "C", - 4: "D", - 5: "E", - 6: "F", - 7: "G", - 8: "H", - 9: "I", - 10: "J", - 11: "K", - 12: "L", - 13: "M", - 14: "N", - 15: "O", - 16: "P", - 17: "Q", - 18: "R", - 19: "S", - 20: "T", - 21: "U", - 22: "V", - 23: "W", - 24: "X", - 25: "Y", - 26: "Z", - 27: "0", - 28: "1", - 29: "2", - 30: "3", - 31: "4", - 32: "5", - 33: "6", - 34: "7", - 35: "8", + 0: "A", + 1: "B", + 2: "C", + 3: "D", + 4: "E", + 5: "F", + 6: "G", + 7: "H", + 8: "I", + 9: "J", + 10: "K", + 11: "L", + 12: "M", + 13: "N", + 14: "O", + 15: "P", + 16: "Q", + 17: "R", + 18: "S", + 19: "T", + 20: "U", + 21: "V", + 22: "W", + 23: "X", + 24: "Y", + 25: "Z", + 26: "0", + 27: "1", + 28: "2", + 29: "3", + 30: "4", + 31: "5", + 32: "6", + 33: "7", + 34: "8", + 35: "9", } diff --git a/Instructions/alternate-chart.odt b/Instructions/alternate-chart.odt index 0825f70..976d064 100644 Binary files a/Instructions/alternate-chart.odt and b/Instructions/alternate-chart.odt differ diff --git a/Instructions/alternate-chart.pdf b/Instructions/alternate-chart.pdf index 049a67d..30de8eb 100644 Binary files a/Instructions/alternate-chart.pdf and b/Instructions/alternate-chart.pdf differ diff --git a/Instructions/dice-one-time-pad.odt b/Instructions/dice-one-time-pad.odt index e801ec6..f5b018a 100644 Binary files a/Instructions/dice-one-time-pad.odt and b/Instructions/dice-one-time-pad.odt differ diff --git a/Instructions/dice-one-time-pad.pdf b/Instructions/dice-one-time-pad.pdf index f9fd1f2..6de85ca 100644 Binary files a/Instructions/dice-one-time-pad.pdf and b/Instructions/dice-one-time-pad.pdf differ