Skip to content

Instantly share code, notes, and snippets.

@leonjza
Created August 13, 2014 15:57
Show Gist options
  • Save leonjza/aa077dc231c147635700 to your computer and use it in GitHub Desktop.
Save leonjza/aa077dc231c147635700 to your computer and use it in GitHub Desktop.
Flick SSH Banner generator
import base64
string = 'tabupJievas8Knoj'
iterations = 15
string_parts = 80
current = 0
current_string = string
# encode with base64 encoding
while current <= iterations:
current_string = base64.b64encode(current_string)
current +=1
# hexencode
current_string = "\\x".join("{:02x}".format(ord(c)) for c in current_string)
print current_string
# split it up into equal parts
current_string = [current_string[x:x+string_parts] for x in range(0,len(current_string),string_parts)]
print 'Final output:\n'
for part in current_string:
print "\\x" + part.rstrip("\\x")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment