Example #1
0
def encrypt():
    text1 = request.form['text']
    rot1 = request.form['rot']
    rotated = rotate_string(text1,int(rot1))
    print(rotated)
    new_text = rotated
    updated_form = form.format(new_text)
    return updated_form
Example #2
0
def encrypt():

    #ROT VALUE HANDLING
    rot_value = request.form['rot']
    try:
        rot_value = int(rot_value)
    except ValueError:
        return render_template('value_error_template.html',
                               invalid_char="'" + rot_value + "'")


#MESSAGE HANDLING
    user_message = request.form['text']
    encrypted_message = rotate_string(user_message, rot_value)
    return render_template('caeser_form.html',
                           success_banner="YOUR ENCRYPTED MESSAGE:",
                           message=encrypted_message)
Example #3
0
def encrypt():
    solution = rotate_string(request.form['text'], int(request.form['rot']))
    return form.format(solution)
Example #4
0
def encrypt():
    rot = int(request.form['rot'])
    text = request.form['text']
    rotated = rotate_string(text, rot)
    return form.format(rotated)
Example #5
0
def encrypt():
    rot = int(request.form["rot"])
    text = request.form["text"]
    encrypted_text = rotate_string(text, rot)
    return form.format(encrypted_text)
Example #6
0
def encrypt():
    user_string = request.form['text']
    rot = int(request.form['rot'])
    return form.format(rotate_string(user_string, rot))
Example #7
0
def encrypt():
    rot = int(request.form['rot'])
    text = request.form['text']
    output = rotate_string(text, rot)
    return redirect("/?text=" + output)
Example #8
0
def encrypt():
    rotate_number = int(request.form['rot'])
    string = request.form['text']
    if request.method == 'POST':
        message = rotate_string(string, rotate_number)
        return "<h1>" + form.format(message) + "</h1>"