Example #1
0
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"Зашифровать")
Example #2
0
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'Зашифровать')
Example #3
0
 def test_encryption(self):
     keys = jbelt.genKeys()
     ecrypted = jbelt.enc(test_xml, str(keys['pub']))
     jbelt.dec(ecrypted, str(keys['priv']))