<commit_before>from Crypto.PublicKey import RSA
from Crypto import Random

class RSACrypt:
    
    def __init__(self):
	random_generator = Random.new().read
	self.key = RSA.generate(2048, random_generator)
	self.public_key = self.key.publickey()
	#print "Key generated, maximum number of bytes that it can handle is: " + str(self.public_key.size())
    
    def public_key_encrypt(self, data):
	enc_data = self.public_key.encrypt(data, 8192)
	return enc_data

    def private_key_decrypt(self, enc_data):
	data = self.key.decrypt(enc_data)
	return data

    def public_key_decrypt(self, enc_data):
	return self.public_key.decrypt(enc_data)

    def public_key_string(self):
	return self.public_key.exportKey('PEM')
    
    def import_public_key(self,new_public_key):
	self.public_key = RSA.importKey(new_public_key)

    def size_cap(self):
	return self.public_key.size()<commit_msg>Bringing over the last unstaged change for rsacrypt.<commit_after>from Crypto.PublicKey import RSA
from Crypto import Random

class RSACrypt:
    
    def __init__(self):
	random_generator = Random.new().read
	self.key = RSA.generate(2048, random_generator)
	self.public_key = self.key.publickey()
	#print "Key generated, maximum number of bytes that it can handle is: " + str(self.public_key.size())
    
    def public_key_encrypt(self, data):
	enc_data = self.public_key.encrypt(data, 8192)
	return enc_data

    def private_key_decrypt(self, enc_data):
	data = self.key.decrypt(enc_data)
	return data

    def public_key_decrypt(self, enc_data):
	return self.public_key.decrypt(enc_data)

    def public_key_string(self):
	return self.public_key.exportKey('PEM')

    def private_key_string(self):
	return self.key.exportKey('PEM')
    
    def import_public_key(self,new_public_key):
	self.public_key = RSA.importKey(new_public_key)

    def size_cap(self):
	return self.public_key.size()
{'fraction_non_alphanumeric': 0.10010649627263046, 'fraction_numerical': 0.008519701810436636, 'mean_word_length': 4.746177370030581, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2196990', 'n_tokens_mistral': 675, 'n_tokens_neox': 646, 'n_words': 138}