コード例 #1
0
def c1():
    EXAMPLE_INPUT = ('49276d206b696c6c696e6720796f757220627261696e206c696b65206120706f69736f6e6f7573206d757368726f6f6d')
    EXAMPLE_OUTPUT = 'SSdtIGtpbGxpbmcgeW91ciBicmFpbiBsaWtlIGEgcG9pc29ub3VzIG11c2hyb29t'

    result = crypto.hex_to_base64(EXAMPLE_INPUT)
    print(result)
    expect(result, EXAMPLE_OUTPUT)
コード例 #2
0
ファイル: 1-basics.py プロジェクト: bgnash/cryptopals
def challenge_1():
	hex_string = "49276d206b696c6c696e6720796f757220627261696e206c696b65206120706f69736f6e6f7573206d757368726f6f6d"
	expected_result = "SSdtIGtpbGxpbmcgeW91ciBicmFpbiBsaWtlIGEgcG9pc29ub3VzIG11c2hyb29t"

	result = crypto.hex_to_base64(hex_string)
	
	test(expected_result, result)
コード例 #3
0
ファイル: challenges.py プロジェクト: mmueller/cryptopals
def c1():
    EXAMPLE_INPUT = \
        ('49276d206b696c6c696e6720796f757220627261696e206c' +
         '696b65206120706f69736f6e6f7573206d757368726f6f6d')
    EXAMPLE_OUTPUT = \
        'SSdtIGtpbGxpbmcgeW91ciBicmFpbiBsaWtlIGEgcG9pc29ub3VzIG11c2hyb29t'
    result = crypto.hex_to_base64(EXAMPLE_INPUT)
    print(result)
    expect(result, EXAMPLE_OUTPUT)
コード例 #4
0
ファイル: chal1.py プロジェクト: Grazfather/cryptopals
import base64

import crypto

input = "49276d206b696c6c696e6720796f757220627261696e206c696b65206120706f69736f6e6f7573206d757368726f6f6d"

print "Hex input:"
print input
print "Plaintext:"
print crypto.hex_to_str(input)
print "Encoded"
print crypto.hex_to_base64(input)