import random
output = set()
santa = 0
used = {0}
people = {0: "ufo",
1: "rebane",
2: "todarac",
3: "nekramite",
4: "joey",
5: "warlord",
6: "ranch",
7: "iron",
8: "lamp",
9: "pint",
10: "entropy",
11: "bird",
12: "futsin",
13: "zippie",
14: "jordan",
15: "rathause",
16: "rain",
17: "dark",
18: "bro",
19: "chipoff"
}
def announce(p1, p2):
output.add("{}:{} gives to ||{}||".format(p1, people[p1], p2))
while len(used) < len(people):
while True: # retry until valid
x = random.randint(0, len(people) - 1)
if x != santa and x not in used:
announce(santa, x)
used.add(x) # receiver may not receive again
santa = x # receiver becomes next santa
break
announce(santa, 0) # force close the loop
print(used)
for line in output:
print(line)
(edited)import random
output = set()
santa = 0
used = {0}
people = {0: "ufo",
1: "rebane",
2: "todarac",
3: "nekramite",
4: "joey",
5: "warlord",
6: "ranch",
7: "iron",
8: "lamp",
9: "pint",
10: "entropy",
11: "bird",
12: "futsin",
13: "zippie",
14: "jordan",
15: "rathause",
16: "rain",
17: "dark",
18: "bro",
19: "chipoff"
}
def announce(p1, p2):
output.add("{}:{} gives to ||{}||".format(p1, people[p1], p2))
while len(used) < len(people):
while True: # retry until valid
x = random.randint(0, len(people) - 1)
if x != santa and x not in used:
announce(santa, x)
used.add(x) # receiver may not receive again
santa = x # receiver becomes next santa
break
announce(santa, 0) # force close the loop
print(used)
for line in output:
print(line)
(edited)people = [rebane, popstonia, ...]
msgs = []
people.shuffle()
for i in range(len(people)):
msgs.append(f"{people[i]} gives to ||{people[i-1] + randompadding()}||")
msgs.shuffle()
print(msgs)
people = [rebane, popstonia, ...]
msgs = []
people.shuffle()
for i in range(len(people)):
msgs.append(f"{people[i]} gives to ||{people[i-1] + randompadding()}||")
msgs.shuffle()
print(msgs)
people = [rebane, popstonia, ...]
msgs = []
people.shuffle()
for i in range(len(people)):
msgs.append(f"{people[i]} gives to ||{people[i-1] + randompadding()}||")
msgs.shuffle()
print(msgs)
import random
people = ["ufo", "rebane", "todarac", "nekramite", "joey", "warlord", "ranch", "iron",
"lamp", "pint", "entropy", "bird", "futsin", "zippie", "jordan", "rathause",
"rain", "dark", "bro", "chipoff"]
msgs = []
random.shuffle(people)
print(people)
for i in range(len(people)):
msgs.append(f"{people[i]} gives to ||{people[i - 1]}{(random.randint(1, 5) * ' ')}||")
random.shuffle(msgs)
for m in msgs:
print(m)
silver
rebane
pepsi
todarac
zippie
p5
joey
raanch
ufo
iron
lamp
pint
mothra
entropy
bird
futsi
jordan
bread
rain
breithan
chipoff
dark
dec
yomo
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHJTG+7YbY1yRtTd4Hso2SzT3Mgl398VETLj/fimWOpW [email protected]
k[0] &= 0xF8;
k[31] &= 0x7F;
k[31] |= 0x40;
is a required operation on the private key after generating the random noise for x25519 (edited)k[0] &= 0xF8;
k[31] &= 0x7F;
k[31] |= 0x40;
is a required operation on the private key after generating the random noise for x25519 (edited)echo "AAAAC3NzaC1lZDI1NTE5AAAAIHJTG+7YbY1yRtTd4Hso2SzT3Mgl398VETLj/fimWOpW" base64 -d | hexdump -C
Extracted public:
72 53 1b ee d8 6d 8d 72 46 d4 dd e0 7b 28 d9 2c d3 dc c8 25 df df 15 11 32 e3 fd f8 a6 58 ea 56
(edited)72531beed86d8d7246d4dde07b28d92cd3dcc825dfdf151132e3fdf8a658ea56
final byte[] rebanePublicKeyBytes = ByteUtil.hexStringToBytes("72531beed86d8d7246d4dde07b28d92cd3dcc825dfdf151132e3fdf8a658ea56");
final X25519Key myKey = generateX25519Key();
// My public key: 4EDBA1DEB00981795253D80D9A41938EFC2B554F0D3C24B96B73E8EE5A92224F
System.out.println("My public key: " + ByteUtil.bytesToHexString(myKey.publicKeyBytes));
final byte[] sharedSecret = rawKeyExchangeX25519(myKey.privateKeyBytes, rebanePublicKeyBytes);
// Shared secret ends with: FEC75F6FC06FAFAE87DDC918DC303B3F
System.out.println("Shared secret: " + ByteUtil.bytesToHexString(sharedSecret));
My public key: 6BC2976C8AFCE563B2DAD8D53A1068EC70C4DC221D310574ABCEBB4E7BB76F2D
Shared secret: 809D0AB80EBC614763A3CEB5DCF0A1944A760C32F319CEAA43CE841C2391843A
Shared secret: 07ACEE62BE188542CE7E263FB628EC59F194D7D7EA943D0B5A02CCBFD3760062
final Ed25519Key testKey = generateEd25519Key();
final X25519Key myKey = generateX25519Key();
System.out.println("My public key: " + ByteUtil.bytesToHexString(myKey.publicKeyBytes));
final byte[] sharedSecret = rawKeyExchangeX25519(myKey.privateKeyBytes, testKey.publicKeyBytes);
System.out.println("Shared secret: " + ByteUtil.bytesToHexString(sharedSecret));
final byte[] testKeySharedSecret = rawKeyExchangeX25519(testKey.privateKeyBytes, myKey.publicKeyBytes);
System.out.println("Shared secret: " + ByteUtil.bytesToHexString(testKeySharedSecret));
(edited)X25519 private key: 7015932D33BE6C26D54186FF55E45AA3A0AC13D3313AFAD73EE2004810A19872
X25519 public key: 49ED9CB0850B17011BF9AA08604286FC3D4BA1B05710E8C8E426CADB58E9D208
Ed25519 private key: 7015932D33BE6C26D54186FF55E45AA3A0AC13D3313AFAD73EE2004810A19872
Ed25519 public key: F866727CD3530390F099B244BF93CA70DCC8A0758D244A0EBCB1FB24D497B8B5
public void rebane() {
// Ed25519
final X25519Key x25519Key = generateX25519Key();
System.out.println("X25519 private key: " + ByteUtil.bytesToHexString(x25519Key.privateKeyBytes));
System.out.println("X25519 public key: " + ByteUtil.bytesToHexString(x25519Key.publicKeyBytes));
final byte[] publicKeyBytes = new byte[Ed25519PublicKeyParameters.KEY_SIZE];
Ed25519.generatePublicKey(x25519Key.privateKeyBytes, 0, publicKeyBytes, 0);
final Ed25519Key ed25519Key = new Ed25519Key(x25519Key.privateKeyBytes, publicKeyBytes);
validateEd25519(ed25519Key.privateKeyBytes, ed25519Key.publicKeyBytes);
System.out.println("Ed25519 private key: " + ByteUtil.bytesToHexString(ed25519Key.privateKeyBytes));
System.out.println("Ed25519 public key: " + ByteUtil.bytesToHexString(ed25519Key.publicKeyBytes));
}
AAAAAAAAAAAAAHHHHHRHRGRGRGRRRGURBHJB EORWPSOJWPJORGWOIRGWSGODEWPGOHEPW09GJEDPOKSD!!!!!!!!!!!!!!!0924QU8T63095JRGHWPE09UJ0PWHRGW
private static final String PLAINTEXT =
("Welcome to The Rust Programming Language, an introductory book about Rust. " +
"The Rust programming language helps you write faster, more reliable software. " +
"High-level ergonomics and low-level control are often at odds in programming language design; " +
"Rust challenges that conflict. Through balancing powerful technical capacity and a great developer " +
"experience, Rust gives you the option to control low-level details (such as memory usage) without " +
"all the hassle traditionally associated with such control.");
-----BEGIN PGP PUBLIC KEY BLOCK-----
mDMEY7WBlRYJKwYBBAHaRw8BAQdAFoIEzUtdkJj5RJo3c7sdY9VHsVxwv2kU2I8e
1I38dXO0CHdhbm5hY3J5iJkEExYKAEEWIQQrtAwJ1zuWZVLVdKGxjanvr7jKTwUC
Y7WBlQIbAwUJA8P1iwULCQgHAgIiAgYVCgkICwIEFgIDAQIeBwIXgAAKCRCxjanv
r7jKT1+XAQDCVmS5LhdRYxKj0ISwL1G7zL0UACjIVvofAH2DN1VsyAEAzKiG/zB4
K9OB+UCZUw3EU+6Om75BzPZ5NAUzPmQ1dw+4OARjtYGVEgorBgEEAZdVAQUBAQdA
8YTGDl3HzQjkYv4QpWTB63vxd2kkx7BGrVDYm+/U7n8DAQgHiH4EGBYKACYWIQQr
tAwJ1zuWZVLVdKGxjanvr7jKTwUCY7WBlQIbDAUJA8P1iwAKCRCxjanvr7jKTzla
AQDCQX7OpHpOlbCvnhhe5Bq29SnhQsgkoxMkh0jEVe1iiAD/WL06kBXqy4IR1akj
Bt+gU7hHmHXhsyy66rUpZq6soQY=
=ffzd
-----END PGP PUBLIC KEY BLOCK-----