SHARE
TWEET

Untitled

a guest Mar 20th, 2017 47 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. io.on(‘connection’, function(socket){
  2. ….
  3. // Test accepting dummy AES key message
  4. socket.on(‘aes client encrypted message’, function (data) {
  5. // console.log(‘Server received AES message from client’, ‘\n’, ‘Encrypted message is’, ‘\n’, data);
  6. console.log(‘Decrypted message’, ‘\n’, aesWrapper.decrypt(aesKey, data));
  7. // Test send client dummy AES message
  8. let message = aesWrapper.createAesMessage(aesKey, ‘Server AES message’);
  9. socket.emit(‘aes server encrypted message’, message);
  10. });
RAW Paste Data
Top