import React, {useContext} from 'react'; import {Divider, SegmentGroup, StatisticLabel, StatisticValue} from "semantic-ui-react"; import {Route, Routes} from "react-router-dom"; import "../static/wrolpi.css"; import {decryptOTP, encryptOTP} from "../api"; import {mimetypeColor, PageContainer, useTitle} from "./Common"; import {ThemeContext} from "../contexts/contexts"; import {Button, Header, Loader, Segment, Statistic, StatisticGroup, TextArea} from "./Theme"; import {useFileStatistics} from "../hooks/customHooks"; class Encrypt extends React.Component { constructor(props) { super(props); this.state = { otp: '', plaintext: '', ciphertext: '', } } handleSubmit = async (e) => { e.preventDefault(); try { let {otp, plaintext, ciphertext} = await encryptOTP(this.state.otp, this.state.plaintext); this.setState({otp, plaintext, ciphertext}); } catch (e) { console.error(e); } } handleInputChange = async (event, {name, value}) => { this.setState({[name]: value}); } render() { return <>
Encrypt

Key