By Dan Hagon. CC0 License.
The problem was described by @solvemymaths:
https://twitter.com/solvemymaths/status/733780754040299520
This solution is based on the one given by Colin Beveridge:
""" | |
Simple EDSAC Assembler. | |
The MIT Liecense. | |
Copyright (C) Daniel Hagon, 2017. | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. |
# Solution to http://www.bbc.co.uk/programmes/articles/5m5cv4NM5dWx108YgCQXj9J/can-you-crack-gchqs-code-breaker-challenge | |
# By Dan Hagon, 19/11/2016. | |
# CC0 License. | |
samuel_lines = [ | |
# 2 7 9 2 5 2 2 5 3 8 2 6 7 | |
"IN AAAAIAN INAAANAIA IA IAINA AI AA IAIIA IAA AAIAAINN AA IAAANN IAINANI", | |
"NA ANNNNMA NAANIANMN NN ANNAN NN AM MNNNN ANI MAAINNIA AM NNAMIA NNAANIN", | |
"AM MMIAAMA MMIMAAMMA MM AMAAA MA AM AAAMA AAA MAMAAAAM AM AAIMMM MMMMAMA" |
# via https://twitter.com/JohnAllenPaulos/status/743085219511554049 | |
import string | |
import random | |
print 64.0 / float(string.count(bin(reduce(lambda x,y: x | (1L<<y), [random.randint(1,64) for _ in range(64)])), '0') - 1) |
By Dan Hagon. CC0 License.
The problem was described by @solvemymaths:
https://twitter.com/solvemymaths/status/733780754040299520
This solution is based on the one given by Colin Beveridge:
The MIT License (MIT) | |
Copyright (c) 2016 Dan Hagon | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFT |
#!/usr/bin/evn python | |
""" | |
Cryptanalysis of "Cipher" puzzle, Stage 5, Director GCHQ's Christmas Puzzle 2015 | |
================================================================================ | |
http://www.gchq.gov.uk/press_and_media/news_and_features/Pages/Director%27s-Christmas-puzzle-2015.aspx | |
Puzzle Crown Copyright. | |
SPOILER ALERT - If you're attempting the puzzle and you don't want to find out | |
any hints do not read ahead! |
#!/usr/bin/env python | |
""" | |
Partial Solution, "Registration" Stage 5 Director GCHQ's Christmas Puzzle 2015. | |
=============================================================================== | |
http://www.gchq.gov.uk/press_and_media/news_and_features/Pages/Director%27s-Christmas-puzzle-2015.aspx | |
Puzzle Crown Copyright. | |
SPOILER ALERT - If you're attempting the puzzle and you don't want to find out | |
any hints do not read ahead! |
#!/usr/bin/env python | |
""" | |
Solution to "Algebraic" from Stage 5 of Director GCHQ's Christmas Puzzle 2015. | |
============================================================================== | |
http://www.gchq.gov.uk/press_and_media/news_and_features/Pages/Director%27s-Christmas-puzzle-2015.aspx | |
Puzzle Crown Copyright. | |
SPOILER ALERT - If you're attempting the puzzle and you don't want to find out | |
any hints do not read ahead! |
/* | |
Backdoor found in GCHQ Christmas Puzzle | |
======================================= | |
SPOILER ALERT - If you're attempting the puzzle and you don't want to find out | |
any hints do not read ahead!* | |
Yesterday I completed Part 4 of the GCHQ Christmas Puzzle | |
[http://www.gchq.gov.uk/press_and_media/news_and_features/Pages/Director%27s-Christmas-puzzle-2015.aspx]. |
import requests | |
import json | |
for page in range (50): | |
# Must be 100 entries at a time | |
params = (100, 100*page) | |
# Replace axiomsofchoice with your own feed | |
r = requests.get('http://friendfeed-api.com/v2/feed/axiomsofchoice?fof=1&hidden=1&raw=1&num=%d&start=%d' % params) | |