Skip to content

Instantly share code, notes, and snippets.

View codewithshehraz's full-sized avatar

Shehraz Khan codewithshehraz

  • Lahore
View GitHub Profile

Keybase proof

I hereby claim:

  • I am codewithshehraz on github.
  • I am shehrazkhan (https://keybase.io/shehrazkhan) on keybase.
  • I have a public key ASCzbnT_3SBH5CJc1flch1lZo3KCFZqkYVc8x4a8S-bwbwo

To claim this, I am signing this object:

@codewithshehraz
codewithshehraz / App.js
Created November 12, 2020 19:11
Encrypt in java and Decrypt in Node or vice versa
import React from "react";
import "./styles.css";
import CryptoJS from "crypto-js";
export default function App() {
const [encryptedBase64Key, setEncryptedBase64Key] = React.useState("");
const [encryptedCipherText, setEncryptedCipherText] = React.useState("");
const [decryptedCipherText, setDecryptedCipherText] = React.useState("");
const decrypt = () => {
//var encryptedBase64Key = "aXRzaG91bGRiZTE2Y2hhcg==";
var parsedBase64Key = CryptoJS.enc.Base64.parse(encryptedBase64Key);