tughra
v1.0.1
Published
The Tughra Library offers robust End-to-End Encryption (E2EE), ensuring that data remains private and secure from the point it leaves the sender to the moment it reaches the intended recipient. With E2EE, data is encrypted on the sender's device, transmit
Downloads
151
Maintainers
Keywords
Readme
<!-- Link to Tughra Library (local file) --> <script src="tughra.js"></script>
<!-- Link to Tughra Library (CDN) --> <script src="https://cdn.jsdelivr.net/npm/[email protected]/tughra.min.js"> </script> <!-- Link to Tughra Library (UNPKG) --> <script src="https://unpkg.com/[email protected]/tughra.min.js"> </script>
<style> /* Your CSS styling here */ </style> </head> <body> <!-- HTML content here --> </body> </html>
<!-- Link to Tughra Library --> <script src="tughra.js"></script>
<!-- Link to Tughra Library (CDN) --> <script src="https://cdn.jsdelivr.net/npm/[email protected]/tughra.min.js"> </script> <!-- Link to Tughra Library (UNPKG) --> <script src="https://unpkg.com/[email protected]/tughra.min.js"> </script>
<style>
/* Your CSS styling here */
</style>
</head>
<body>
<!-- HTML content here -->
<div class="container">
<h1>Tughra Encryption Demo</h1>
<label for="inputText">Enter Text to Encrypt:</label>
<input type="text" id="inputText" placeholder="Type something...">
<button onclick="encryptText()">Encrypt Text</button>
<h2>Encrypted Result:</h2>
<p id="encryptedOutput">Your encrypted text will appear here.</p>
</div>
<!-- JavaScript for Tughra library -->
<script>
// Initialize the Tughra library and add encryption function
document.addEventListener('DOMContentLoaded', function () {
const tughra = new Tughra('encrypt', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'caesar', 'myKey');
window.encryptText = function () {
const inputText = document.getElementById('inputText').value;
if (inputText) {
const encryptedText = tughra.process(inputText, 3); // Adjust cycles as needed
document.getElementById('encryptedOutput').innerText = encryptedText;
} else {
document.getElementById('encryptedOutput').innerText = 'Please enter text to encrypt.';
}
};
});
</script>
</body>
</html>