import React, {useContext} from 'react'; import { Divider, Input, Label, SegmentGroup, StatisticLabel, StatisticValue, TableCell, TableRow } from "semantic-ui-react"; import {Link, Route, Routes} from "react-router"; import {decryptOTP, encryptOTP} from "../api"; import { APIButton, ErrorMessage, humanFileSize, humanNumber, mimetypeColor, PageContainer, toLocaleString, useTitle } from "./Common"; import {ThemeContext} from "../contexts/contexts"; import {Button, Header, Loader, Segment, Statistic, Table, TextArea} from "./Theme"; import {useStatistics, useVINDecoder} from "../hooks/customHooks"; import {CalculatorsPage} from "./Calculators"; 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