JSFiddle - React, Tailwind, and code Playground

by Hoàng Phương Trương

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.9-1/crypto-js.min.js"></script>
<table>
  <thead>
    <tr>
      <td>Encrypted</td>
      <td>Search Index</td>
    </tr>
  </thead>
  <tbody id="table-body">
    
  </tbody>
</table>

CSS

table {
  border-collapse: collapse;
}

tr, td {
  border: 1px solid black;
}

JavaScript

const tbody = document.getElementById('table-body');
const message = 'AAAAAAAAAAAAAAAA';

for (let i = 0; i < 10; i++) {
	const encrypted = CryptoJS.AES.encrypt(message, 'secret');
  const index = CryptoJS.HmacSHA256(message, 'index_secret');
  
  tbody.innerHTML += `<tr>
    <td>${encrypted}</td>
    <td>${index}</td>
	<tr>`;
}