import React from 'react'; import {Button, Divider, Segment, TextArea} from "semantic-ui-react"; import {Route} from "react-router-dom"; import "../static/wrolpi.css"; import {decryptOTP, encryptOTP} from "../api"; import {PageContainer} from "./Common"; class Encrypt extends React.Component { constructor(props) { super(props); this.state = { otp: '', plaintext: '', ciphertext: '', } } handleSubmit = async (e) => { e.preventDefault(); let {otp, plaintext, ciphertext} = await encryptOTP(this.state.otp, this.state.plaintext); this.setState({otp, plaintext, ciphertext}); } handleInputChange = async (event, {name, value}) => { this.setState({[name]: value}); } render() { return ( <>

Encrypt

Key