More stuff

This commit is contained in:
Dan Seripap 2016-01-08 20:19:14 -05:00
parent b40f50d445
commit b9f2919b93
2 changed files with 10 additions and 1 deletions

View File

@ -22,6 +22,7 @@ $(function() {
var $messages = $('.messages'); // Messages area var $messages = $('.messages'); // Messages area
var $inputMessage = $('.inputMessage'); // Input message input box var $inputMessage = $('.inputMessage'); // Input message input box
var $key = $('#key'); var $key = $('#key');
var $genKey = $('#new_key');
var $chatPage = $('.chat.page'); // The chatroom page var $chatPage = $('.chat.page'); // The chatroom page
@ -253,6 +254,11 @@ $(function() {
$inputMessage.focus(); $inputMessage.focus();
}); });
$genKey.click(function () {
var key = CryptoJS.SHA3(Math.random().toString(36).substring(7)).toString();
$key.val(key);
});
// Socket events // Socket events
// Whenever the server emits 'login', log the login message // Whenever the server emits 'login', log the login message

View File

@ -31,7 +31,10 @@
<h4 class="modal-title">Chat Encryption Key</h4> <h4 class="modal-title">Chat Encryption Key</h4>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<p>This is your chat encryption key. Anyone who is in this chat room must use the same key to decrypt chat messages. This key is <strong>NOT</strong> stored nor transmitted to the server. If the key does not match, other clients will see encrypted messages. You may change the key as many times as you want.</p> <p>This chat encryption key is randomly generated by every client. Clients must use the same chat key to decrypt chat messages. This key is <strong>NOT STORED</strong> nor transmitted to the server. Regardless if the room URL was shared, chat messages will appear as hash values until the same key is used between clients. You may change the key as many times as you want.</p>
<div class="form-group">
<button id="new_key" class="form-control btn btn-info btn-xs">Generate new key</button>
</div>
<div class="form-group"> <div class="form-group">
<textarea id="key" class="form-control" rows="2" placeholder="Enter key here"></textarea> <textarea id="key" class="form-control" rows="2" placeholder="Enter key here"></textarea>
</div> </div>