115
votes
41
votes
Proving that a Russian cryptographic standard is too structured
AMD64 Assembly (78 bytes or 624 bits of machine code)
uint8_t SubByte(uint8_t x) {
uint8_t y,z;
uint8_t s[]=
{1,221,146,79,147,153,11,68,214,215,78,220,152,10,69};
uint8_t k[]=
...
34
votes
Accepted
Print a Tabula Recta!
05AB1E, 6 5 bytes
Thanks to Downgoat for saving 1 byte. Code:
ADv=À
Explanation:
...
30
votes
Print a Tabula Recta!
Python 2, 59 57 53 bytes
a=range(65,91)*27
a[::-27]=[10]*26
print bytearray(a)
Thanks to @xsot for -4 bytes!
29
votes
Proving that a Russian cryptographic standard is too structured
CJam, 72 67 66 63 bytes
ri{_2md142*^}es*]2#~Hmd{5\}e|Fm2b"Ý0$&ÜÖD
×EON".*Lts:^i
...
26
votes
Proving that a Russian cryptographic standard is too structured
Jelly 71 59 bytes
H^142ƊHḂ?Ƭi2d17U⁸⁴;$Ḣ?$CµṪạ⁴B¬T;;6ị“Œ0$&ØŀWð⁺Ṫ\ḢĠVı⁻¹]°Ẇ‘^/
Try it online!
Verify all possibilities
Now rewritten using a reworked ...
20
votes
18
votes
Print a Tabula Recta!
C, 47 bytes
i;f(){for(i=702;i--;)putchar(i%27?90-i%26:10);}
Try it on Ideone
A single loop, printing the alphabet every 26 characters but with every 27th ...
18
votes
Proving that a Russian cryptographic standard is too structured
C (gcc), 157 148 140 139 bytes
Modest improvement over the C example.
...
18
votes
MD5 Hello, World!
Python, 360 + 360 = 720 bytes 206 + 206 = 412 bytes 201 + 201 = 402
Hi, my two cents. This answer is inspired by this blog by Nat McHugh.
A short introduction to explain the idea behind the code.
MD5 ...
16
votes
16
votes
Print a Tabula Recta!
///, 128 bytes
/:/fABCDEFGHIJKLMNOPQRSTUVWXYZ
fbfbAfxf
xbA_xf_x
xfbbbAfbb//x/bff//f/\///b/\\:B:C:D:E:F:G:H:I:J:K:L:M:N:O:P:Q:R:S:T:U:V:W:X:Y:Z:
Try it online!
...
16
votes
15
votes
Proving that a Russian cryptographic standard is too structured
Stax, 65 64 62 59 58 bytes
ç∙¼≥2▼Uó╤áπ╙º┐╩♫∟öv◘≥δ♦Θ╫»─kRWÑâBG")≥ö0╥kƒg┬^S ΔrΩ►╣Wü Ü╕║
Run and debug it
Unfortunately, this program uses some instructions that ...
14
votes
Cryptographic quine variant
Python 2, 91 bytes
s="import md5;print'MD5 sum of my source is: '+md5.new('s=%r;exec s'%s).hexdigest()";exec s
Using the Python quine variant which doesn't ...
13
votes
Accepted
Shamir's Secret Sharing
Jelly, 15 bytes
251©xX€⁵0¦ḅЀ%®
Expects t, n, and s as command-line arguments. Try it online!
How it works
...
13
votes
Print a Tabula Recta!
Emacs, 47 bytes
abcdefghijklmnopqrstuvwxyz^M
^P
<F3>
^K ^K ^Y ^Y
^P
^<space> ^F ^W ^E ^Y ^A
<F4>
^U 2 4 F4
Where ...
12
votes
Print a Tabula Recta!
PowerShell, 37 bytes
25..0|%{-join('Z'..'A')[$_..($_-25)]}
Try it online!
11
votes
Atbash Self Palindromes
Pyth, 10 9 bytes
qJrz0_XJG
Try this fiddle online or verify all test cases at once.
Explanation
...
11
votes
11
votes
Print a Tabula Recta!
JavaScript (ES6), 56 bytes
_=>"ABCDEFGHIJKLMNOPQRSTUVWXYZ".replace(/./g,"$&$'$`\n")
Yes, that's right, half my code is the alphabet string literal. Best I ...
10
votes
Implement Rijndael's S-box
x86-64 Machine code - 23 22 20 19 bytes
Uses the AES-NI instruction set
...
10
votes
ROT-13 transform standard input
R, 37 bytes
example("chartr");cat(rot(scan(,"")))
example("chartr") runs the examples for ...
10
votes
Print a Tabula Recta!
C, 88 64 bytes
Call f() without arguments.
f(i,j){for(i=j=0;i<26;putchar(j==26?j=0,i++,10:65+(i+j++)%26));}
Try it on ideone....
10
votes
Print a Tabula Recta!
Piet, 247 bytes/190 codels
Try it Online!
So, this took far longer than I had anticipated, and I have a few ideas on some other more efficient (more stack-friendly) approaches, but I finally got the ...
10
votes
Write a VIC cipher encoder
Python 3, 1423 1348 1324 1316 1300 1286 1250 1249 1209 1206 1204 bytes
This is definitely the longest golf I've ever done, and the only golf where I was seriously worried about running out of one-...
10
votes
Proving that a Russian cryptographic standard is too structured
05AB1E, 101 100 98 97 95 94 bytes
U•α">η≠ε∍$<Θγ\&@(Σα•₅вV₁[<ÐX*Q#X·₁%Xžy÷Ƶ¹*₁%^₁%U}D17©%DĀiYsès®÷•¾#kôlb¸ù,-ó"a·ú•₅вë\Ƶ∞s®÷Y}sè^
-3 bytes ...
9
votes
9
votes
Substitution cipher
Convex, 4 6 5 bytes
Crossed out 4 is still regular 4 :(
Note: As @Dennis pointed out, the input format I was using was not up to spec. This version should comply with the new rules, though.
...
9
votes
Print a Tabula Recta!
MATL, 8 bytes
With thanks to @Dennis, who suggested that MATL should incorporate modular indexing, and to @Suever, who had the idea of automatic pairwise operations.
...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
cryptography × 63code-golf × 52
string × 12
code-challenge × 6
math × 5
random × 4
fastest-code × 3
alphabet × 3
encryption × 3
kolmogorov-complexity × 2
number-theory × 2
cops-and-robbers × 2
polynomials × 2
cipher × 2
hashing × 2
ascii-art × 1
decision-problem × 1
popularity-contest × 1
graphical-output × 1
quine × 1
base-conversion × 1
palindrome × 1
unicode × 1
hello-world × 1
bitwise × 1