def enc(): if request.method == "GET": return render_template("enc.html") key = request.form["key"].strip() xml = request.form["xml"].strip() encrypted = jbelt.enc(xml, base64.b64decode(key)) return render_template("dec.html", xml=prettify(encrypted), button_label=u"Зашифровать")
def enc(): if request.method == 'GET': return render_template('enc.html') key = request.form['key'].strip() xml = request.form['xml'].strip() encrypted = jbelt.enc(xml, base64.b64decode(key)) return render_template('dec.html', xml=prettify(encrypted), button_label=u'Зашифровать')
def test_encryption(self): keys = jbelt.genKeys() ecrypted = jbelt.enc(test_xml, str(keys['pub'])) jbelt.dec(ecrypted, str(keys['priv']))