Skip to main content
deleted 1165 characters in body
Source Link
Wheat Wizard
  • 100k
  • 22
  • 282
  • 661

Python 2, Cracked

This is the second iteration of an answer that has been cracked once by @HyperNuetrino using a method I had not expected. I've now patched it so hopefully the only solutions left will have to abide by the restrictions I intended.

Implements addition as a named function

import sys
c="".join(open(__file__).read().split('\n')[4:])
if set(c)-set(' &)(,.:[]a`cdfijmonrt~')or"import"in c:sys.setrecursionlimit(1)
sys.modules['sys'],sys.modules['os']=None,None;del sys;f=lambda\

Try it online!

What does this do?

For the purposes of helping you out a bit I'll explain what this does. This code opens the source file and checks if the remainder of the code fits the following criteria:

  • Does not contain the string import
  • Is made solely of the characters &)(,.:[]a`cdfijmonrt~

If it fails either criterion the recursion limit is set to 1 meaning that any code you write will hit the recursion limit.

There are no tricks here, I have written a solution that uses only these characters and no imports, I'm not doing anything subversive, but I will say that I think this will be pretty hard to crack.

To save you some time here is a short list of useful things you cannot do with this restriction

  • + well duh,

  • eval/exec Wasn't going to let you get away with that

  • Numbers, They might be more useful than you think

  • String literals

  • len

  • =, No assigning variables

  • >,<,==. . . I have left you with no comparisons

  • *,-,/,%,^,|,>>,<< The only operators available are ~ and &

  • __foo__, None of those fancy double underscore methods are allowed.

Python 2

This is the second iteration of an answer that has been cracked once by @HyperNuetrino using a method I had not expected. I've now patched it so hopefully the only solutions left will have to abide by the restrictions I intended.

Implements addition as a named function

import sys
c="".join(open(__file__).read().split('\n')[4:])
if set(c)-set(' &)(,.:[]a`cdfijmonrt~')or"import"in c:sys.setrecursionlimit(1)
sys.modules['sys'],sys.modules['os']=None,None;del sys;f=lambda\

Try it online!

What does this do?

For the purposes of helping you out a bit I'll explain what this does. This code opens the source file and checks if the remainder of the code fits the following criteria:

  • Does not contain the string import
  • Is made solely of the characters &)(,.:[]a`cdfijmonrt~

If it fails either criterion the recursion limit is set to 1 meaning that any code you write will hit the recursion limit.

There are no tricks here, I have written a solution that uses only these characters and no imports, I'm not doing anything subversive, but I will say that I think this will be pretty hard to crack.

To save you some time here is a short list of useful things you cannot do with this restriction

  • + well duh,

  • eval/exec Wasn't going to let you get away with that

  • Numbers, They might be more useful than you think

  • String literals

  • len

  • =, No assigning variables

  • >,<,==. . . I have left you with no comparisons

  • *,-,/,%,^,|,>>,<< The only operators available are ~ and &

  • __foo__, None of those fancy double underscore methods are allowed.

Python 2, Cracked

This is the second iteration of an answer that has been cracked once by @HyperNuetrino using a method I had not expected. I've now patched it so hopefully the only solutions left will have to abide by the restrictions I intended.

Implements addition as a named function

import sys
c="".join(open(__file__).read().split('\n')[4:])
if set(c)-set(' &)(,.:[]a`cdfijmonrt~')or"import"in c:sys.setrecursionlimit(1)
sys.modules['sys'],sys.modules['os']=None,None;del sys;f=lambda\

Try it online!

Post Undeleted by Wheat Wizard
added 132 characters in body
Source Link
Wheat Wizard
  • 100k
  • 22
  • 282
  • 661

Python 2

This is the second iteration of an answer that has been cracked once by @HyperNuetrino using a method I had not expected but I wanted. I've now patched it so hopefully the only solutions left will have to patchabide by the crackrestrictions I intended.

Implements addition as a named function

import sys
c=""c="".join(open(__file__).read().split('\n')[4:])
if set(c)-set(' &)(,.:[]a`cdfijmonrt~')or"import"inor"import"in c:sys.setrecursionlimit(1)
delsys.modules['sys'],sys.modules['os']=None,None;del sys;f=lambda\
 

Try it online!Try it online!

What does this do?

For the purposes of helping you out a bit I'll explain what this does. This code opens the source file and checks if the remainder of the code fits the following criteria:

  • Does not contain the string import
  • Is made solely of the characters &)(,.:[]a`cdfijmonrt~

If it fails either criterion the recursion limit is set to 1 meaning that any code you write will hit the recursion limit.

There are no tricks here, I have written a solution that uses only these characters and no imports, I'm not doing anything subversive, but I will say that I think this will be pretty hard to crack.

To save you some time here is a short list of useful things you cannot do with this restriction

  • + well duh,

  • eval/exec Wasn't going to let you get away with that

  • Numbers, They might be more useful than you think

  • String literals

  • len

  • =, No assigning variables

  • >,<,==. . . I have left you with no comparisons

  • *,-,/,%,^,|,>>,<< The only operators available are ~ and &

  • __foo__, None of those fancy double underscore methods are allowed.

Python 2

This is the second iteration of an answer that has been cracked once by @HyperNuetrino using a method I had not expected but I wanted to patch the crack.

Implements addition as a named function

import sys
c="".join(open(__file__).read().split('\n')[4:])
if set(c)-set(' &)(,.:[]a`cdfijmonrt~')or"import"in c:sys.setrecursionlimit(1)
del sys;f=lambda\
 

Try it online!

What does this do?

For the purposes of helping you out a bit I'll explain what this does. This code opens the source file and checks if the remainder of the code fits the following criteria:

  • Does not contain the string import
  • Is made solely of the characters &)(,.:[]a`cdfijmonrt~

If it fails either criterion the recursion limit is set to 1 meaning that any code you write will hit the recursion limit.

There are no tricks here, I have written a solution that uses only these characters and no imports, I'm not doing anything subversive, but I will say that I think this will be pretty hard to crack.

To save you some time here is a short list of useful things you cannot do with this restriction

  • + well duh,

  • eval/exec Wasn't going to let you get away with that

  • Numbers, They might be more useful than you think

  • String literals

  • len

  • =, No assigning variables

  • >,<,==. . . I have left you with no comparisons

  • *,-,/,%,^,|,>>,<< The only operators available are ~ and &

  • __foo__, None of those fancy double underscore methods are allowed.

Python 2

This is the second iteration of an answer that has been cracked once by @HyperNuetrino using a method I had not expected. I've now patched it so hopefully the only solutions left will have to abide by the restrictions I intended.

Implements addition as a named function

import sys
c="".join(open(__file__).read().split('\n')[4:])
if set(c)-set(' &)(,.:[]a`cdfijmonrt~')or"import"in c:sys.setrecursionlimit(1)
sys.modules['sys'],sys.modules['os']=None,None;del sys;f=lambda\

Try it online!

What does this do?

For the purposes of helping you out a bit I'll explain what this does. This code opens the source file and checks if the remainder of the code fits the following criteria:

  • Does not contain the string import
  • Is made solely of the characters &)(,.:[]a`cdfijmonrt~

If it fails either criterion the recursion limit is set to 1 meaning that any code you write will hit the recursion limit.

There are no tricks here, I have written a solution that uses only these characters and no imports, I'm not doing anything subversive, but I will say that I think this will be pretty hard to crack.

To save you some time here is a short list of useful things you cannot do with this restriction

  • + well duh,

  • eval/exec Wasn't going to let you get away with that

  • Numbers, They might be more useful than you think

  • String literals

  • len

  • =, No assigning variables

  • >,<,==. . . I have left you with no comparisons

  • *,-,/,%,^,|,>>,<< The only operators available are ~ and &

  • __foo__, None of those fancy double underscore methods are allowed.

Post Deleted by Wheat Wizard
Post Undeleted by Wheat Wizard
Post Deleted by Wheat Wizard
Source Link
Wheat Wizard
  • 100k
  • 22
  • 282
  • 661

Python 2

This is the second iteration of an answer that has been cracked once by @HyperNuetrino using a method I had not expected but I wanted to patch the crack.

Implements addition as a named function

import sys
c="".join(open(__file__).read().split('\n')[4:])
if set(c)-set(' &)(,.:[]a`cdfijmonrt~')or"import"in c:sys.setrecursionlimit(1)
del sys;f=lambda\

Try it online!

What does this do?

For the purposes of helping you out a bit I'll explain what this does. This code opens the source file and checks if the remainder of the code fits the following criteria:

  • Does not contain the string import
  • Is made solely of the characters &)(,.:[]a`cdfijmonrt~

If it fails either criterion the recursion limit is set to 1 meaning that any code you write will hit the recursion limit.

There are no tricks here, I have written a solution that uses only these characters and no imports, I'm not doing anything subversive, but I will say that I think this will be pretty hard to crack.

To save you some time here is a short list of useful things you cannot do with this restriction

  • + well duh,

  • eval/exec Wasn't going to let you get away with that

  • Numbers, They might be more useful than you think

  • String literals

  • len

  • =, No assigning variables

  • >,<,==. . . I have left you with no comparisons

  • *,-,/,%,^,|,>>,<< The only operators available are ~ and &

  • __foo__, None of those fancy double underscore methods are allowed.