Skip to content

Instantly share code, notes, and snippets.

@koma5
Created January 22, 2017 12:43
Show Gist options
  • Save koma5/816c77f42b106845c368de3feb19d5ec to your computer and use it in GitHub Desktop.
Save koma5/816c77f42b106845c368de3feb19d5ec to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Znepb Xbpu (znepb@5gu.pu)\n",
"TWFyY28gS29jaCAobWFyY29ANXRoLmNoKQ==\n",
"\n"
]
}
],
"source": [
"print \"Marco Koch (marco@5th.ch)\".encode('rot13')\n",
"print \"Marco Koch (marco@5th.ch)\".encode('base64')"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"TWFyY28gS29jaCAobWFyY29ANXRoLmNoKQ==\n",
"Marco Koch (marco@5th.ch)\n"
]
}
],
"source": [
"import base64\n",
"\n",
"lol = base64.b64encode('Marco Koch (marco@5th.ch)')\n",
"print lol\n",
"lol = base64.b64decode(lol)\n",
"print lol"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"t = \"\"\"Pull my finger! you know, your bobby dangler, giggle stick, your general-two-colonels, master of ceremonies... yeah, don't be shy, let's have a look. my lord! you're a tripod. at this point, i'd set you up with a chimpanzee if it'd brought you back to the world! i want to shoot the pigeons... off my roof. when i get back, remind to tell you about the time i took 100 nuns to nairobi! you wouldn't hit a man with no trousers on, would you? you are as precious to me as you were to your own mother and father. i swore to them that i would protect you, and i haven't. yes, i used a machine gun. your were only supposed to blow the bloody doors off. your were only supposed to blow the bloody doors off. you're only supposed to blow the bloody doors off!\n",
"I want to shoot the pigeons... off my roof. my lord! you're a tripod. yes, i used a machine gun. pull my finger! i took a viagra, got stuck in me throat, i've had a stiff neck for hours. at this point, i'd set you up with a chimpanzee if it'd brought you back to the world! it's not the size mate, it's how you use it. you wouldn't hit a man with no trousers on, would you? when i get back, remind to tell you about the time i took 100 nuns to nairobi! you're only supposed to blow the bloody doors off! i took a viagra, got stuck in me throat, i've had a stiff neck for hours. you know, your bobby dangler, giggle stick, your general-two-colonels, master of ceremonies... yeah, don't be shy, let's have a look.\"\"\"\n",
"t2 = \"\"\"Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. \n",
"Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. \"\"\" "
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Pull my finger! you know, your bobby dangler, giggle stick, your general-two-colonels, master of ceremonies... yeah, don't be shy, let's have a look. my lord! you're a tripod. at this point, i'd set you up with a chimpanzee if it'd brought you back to the world! i want to shoot the pigeons... off my roof. when i get back, remind to tell you about the time i took 100 nuns to nairobi! you wouldn't hit a man with no trousers on, would you? you are as precious to me as you were to your own mother and father. i swore to them that i would protect you, and i haven't. yes, i used a machine gun. your were only supposed to blow the bloody doors off. your were only supposed to blow the bloody doors off. you're only supposed to blow the bloody doors off!\n",
"I want to shoot the pigeons... off my roof. my lord! you're a tripod. yes, i used a machine gun. pull my finger! i took a viagra, got stuck in me throat, i've had a stiff neck for hours. at this point, i'd set you up with a chimpanzee if it'd brought you back to the world! it's not the size mate, it's how you use it. you wouldn't hit a man with no trousers on, would you? when i get back, remind to tell you about the time i took 100 nuns to nairobi! you're only supposed to blow the bloody doors off! i took a viagra, got stuck in me throat, i've had a stiff neck for hours. you know, your bobby dangler, giggle stick, your general-two-colonels, master of ceremonies... yeah, don't be shy, let's have a look.\n",
"\n",
"Yberz vcfhz qbybe fvg nzrg, pbafrgrghe fnqvcfpvat ryvge, frq qvnz abahzl rvezbq grzcbe vaivqhag hg ynober rg qbyber zntan nyvdhlnz reng, frq qvnz ibyhcghn. Ng ireb rbf rg npphfnz rg whfgb qhb qbyberf rg rn erohz. Fgrg pyvgn xnfq thoretera, ab frn gnxvzngn fnapghf rfg Yberz vcfhz qbybe fvg nzrg. Yberz vcfhz qbybe fvg nzrg, pbafrgrghe fnqvcfpvat ryvge, frq qvnz abahzl rvezbq grzcbe vaivqhag hg ynober rg qbyber zntan nyvdhlnz reng, frq qvnz ibyhcghn. Ng ireb rbf rg npphfnz rg whfgb qhb qbyberf rg rn erohz. Fgrg pyvgn xnfq thoretera, ab frn gnxvzngn fnapghf rfg Yberz vcfhz qbybe fvg nzrg. Yberz vcfhz qbybe fvg nzrg, pbafrgrghe fnqvcfpvat ryvge, frq qvnz abahzl rvezbq grzcbe vaivqhag hg ynober rg qbyber zntan nyvdhlnz reng, frq qvnz ibyhcghn. Ng ireb rbf rg npphfnz rg whfgb qhb qbyberf rg rn erohz. Fgrg pyvgn xnfq thoretera, ab frn gnxvzngn fnapghf rfg Yberz vcfhz qbybe fvg nzrg. \n",
"Qhvf nhgrz iry rhz vevher qbybe va uraqerevg va ihychgngr iryvg rffr zbyrfgvr pbafrdhng, iry vyyhz qbyber rh srhtvng ahyyn snpvyvfvf ng ireb rebf rg npphzfna rg vhfgb bqvb qvtavffvz dhv oynaqvg cenrfrag yhcgnghz mmevy qryravg nhthr qhvf qbyber gr srhtnvg ahyyn snpvyvfv. Yberz vcfhz qbybe fvg nzrg, pbafrpgrghre nqvcvfpvat ryvg, frq qvnz abahzzl avou rhvfzbq gvapvqhag hg ynberrg qbyber zntan nyvdhnz reng ibyhgcng. \n"
]
}
],
"source": [
"print t + '\\n'\n",
"print t2.encode('rot13')"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"UHVsbCBteSBmaW5nZXIhIHlvdSBrbm93LCB5b3VyIGJvYmJ5IGRhbmdsZXIsIGdpZ2dsZSBzdGlj\n",
"aywgeW91ciBnZW5lcmFsLXR3by1jb2xvbmVscywgbWFzdGVyIG9mIGNlcmVtb25pZXMuLi4geWVh\n",
"aCwgZG9uJ3QgYmUgc2h5LCBsZXQncyBoYXZlIGEgbG9vay4gbXkgbG9yZCEgeW91J3JlIGEgdHJp\n",
"cG9kLiBhdCB0aGlzIHBvaW50LCBpJ2Qgc2V0IHlvdSB1cCB3aXRoIGEgY2hpbXBhbnplZSBpZiBp\n",
"dCdkIGJyb3VnaHQgeW91IGJhY2sgdG8gdGhlIHdvcmxkISBpIHdhbnQgdG8gc2hvb3QgdGhlIHBp\n",
"Z2VvbnMuLi4gb2ZmIG15IHJvb2YuIHdoZW4gaSBnZXQgYmFjaywgcmVtaW5kIHRvIHRlbGwgeW91\n",
"IGFib3V0IHRoZSB0aW1lIGkgdG9vayAxMDAgbnVucyB0byBuYWlyb2JpISB5b3Ugd291bGRuJ3Qg\n",
"aGl0IGEgbWFuIHdpdGggbm8gdHJvdXNlcnMgb24sIHdvdWxkIHlvdT8geW91IGFyZSBhcyBwcmV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91J3JlIG9ubHkgc3VwcG9zZWQgdG8gYmxvdyB0aGUgYmxvb2R5IGRvb3JzIG9m\n",
"ZiEgaSB0b29rIGEgdmlhZ3JhLCBnb3Qgc3R1Y2sgaW4gbWUgdGhyb2F0LCBpJ3ZlIGhhZCBhIHN0\n",
"aWZmIG5lY2sgZm9yIGhvdXJzLiB5b3Uga25vdywgeW91ciBib2JieSBkYW5nbGVyLCBnaWdnbGUg\n",
"c3RpY2ssIHlvdXIgZ2VuZXJhbC10d28tY29sb25lbHMsIG1hc3RlciBvZiBjZXJlbW9uaWVzLi4u\n",
"IHllYWgsIGRvbid0IGJlIHNoeSwgbGV0J3MgaGF2ZSBhIGxvb2su\n",
"\n"
]
}
],
"source": [
"print t.encode('base64')"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.0"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment