import React, {useContext} from 'react'; import {Divider, Input, SegmentGroup, StatisticLabel, StatisticValue, TableCell, TableRow} from "semantic-ui-react"; import {Link, Route, Routes} from "react-router-dom"; import {decryptOTP, encryptOTP} from "../api"; import {APIButton, ErrorMessage, humanFileSize, mimetypeColor, PageContainer, toLocaleString, useTitle} from "./Common"; import {ThemeContext} from "../contexts/contexts"; import {Button, Header, Loader, Segment, Statistic, StatisticGroup, Table, TextArea} from "./Theme"; import {useStatistics, useVINDecoder} from "../hooks/customHooks"; class Encrypt extends React.Component { constructor(props) { super(props); this.state = { otp: '', plaintext: '', ciphertext: '', } } handleSubmit = async () => { 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() { const disabled = !(this.state.otp && this.state.plaintext); return <>
Encrypt

Key