diff --git a/app/src/components/Apps.js b/app/src/components/Apps.js index 877cc183..5085c65b 100644 --- a/app/src/components/Apps.js +++ b/app/src/components/Apps.js @@ -1,302 +1,20 @@ -import React, {useContext, useState} from 'react'; -import { - Checkbox, - Divider, - Icon, - Input, - Label, - Radio, - SegmentGroup, - StatisticLabel, - StatisticValue, - TableCell, - TableRow -} from "semantic-ui-react"; +import React, {useContext} from 'react'; +import {Input, Label, StatisticLabel, StatisticValue} from "semantic-ui-react"; import {Link, Route, Routes} from "react-router"; -import { - appendChecksum, - decryptOTP, - encryptOTP, - formatMessage, - generateHtml, - OTP_CHARS, - OTP_CHARS_ALPHA, - stripChecksum, - validateCharset -} from "./otp"; import { ErrorMessage, humanFileSize, humanNumber, mimetypeColor, PageContainer, - SimpleAccordion, toLocaleString, useTitle } from "./Common"; import {ThemeContext} from "../contexts/contexts"; -import {Button, Form, Header, Loader, Segment, Statistic, Table, TextArea} from "./Theme"; -import {useStatistics, useVINDecoder} from "../hooks/customHooks"; +import {Header, Loader, Segment, Statistic} from "./Theme"; +import {useStatistics} from "../hooks/customHooks"; import {CalculatorsPage} from "./Calculators"; -function Encrypt({chars, checksum}) { - // Encrypt happens live as the user types or pastes. Nothing leaves the browser. - const [otp, setOtp] = useState(''); - const [plaintext, setPlaintext] = useState(''); - - const handleInputChange = (event, {name, value}) => { - if (name === 'otp') { - setOtp(value); - } else { - setPlaintext(value); - } - }; - - let ciphertext = ''; - let error = ''; - if (otp && plaintext && chars) { - try { - const raw = encryptOTP(otp, plaintext, chars).ciphertext; - // When enabled, append a checksum character then re-group the whole message+checksum. - ciphertext = checksum ? formatMessage(appendChecksum(raw, chars)) : raw; - } catch (e) { - error = e.message; - } - } - - return <> -
Encrypt
- - -

Key

-