node.js和chrome浏览器之间console.log的奇数输出

我正在玩节点的crypt() ,只是想要确认Diffie-Hillman在节点('Alice')和Chrome客户端('Bob')之间共享的秘密是匹配的。 我把socket.io上的公共密钥发送给对方,并且在他们各自的控制台输出中使用base64编码正确输出,但是当我输出共享密钥时,节点的控制台显示正确,但是Chrome的控制台给了我一串数字。 有什么想法吗?

节点的代码:

 var Alice = crypto.getDiffieHellman(group); Alice.generateKeys('base64'); console.log("receiving Bob's public key from browser"); var BobsPublicKey = message.data; console.log(BobsPublicKey); console.log("sending Alice's public key to browser"); var AlicesPublicKey = Alice.getPublicKey('base64'); console.log(AlicesPublicKey); client.emit('message', AlicesPublicKey); // compute shared secret var AlicesSharedSecret = Alice.computeSecret(BobsPublicKey, 'base64', 'base64'); console.log("Alice's shared secret:"); console.log(AlicesSharedSecret); 

节点的控制台输出(为简洁起见,缩写):

 receiving Bob's public key from browser pyfizI3ALSz6EWnsf4pd3Pc7IVbJyKcLcmbbX1L9jpmZeM... sending Alice's public key to browser cVq2kVHzkSbU/aSwMXmm6CaohiLASnSabuUgp6bsyNMXia... Alice's shared secret: dJqcCugMDw2qCNVZ4ZftLT/rPrOZwfW7PfHJLAh4bGyIyP... 

客户端代码:

 Bob = crypto.getDiffieHellman(group); Bob.generateKeys('base64'); console.log("sending bob's public key from login.vue"); var BobsPublicKey = Bob.getPublicKey('base64'); console.log(BobsPublicKey); this.serverRequest( "client", "passKey", BobsPublicKey); console.log("receiving Alice's public key from node"); var AlicesPublicKey = message.data; console.log(AlicesPublicKey); // computer shared secret var BobsSharedSecret = Bob.computeSecret(AlicesPublicKey, 'base64', 'base64'); console.log("Bob's shared Secret: "); console.log(BobsSharedSecret); 

客户端控制台输出:

 sending bob's public key from login.vue pyfizI3ALSz6EWnsf4pd3Pc7IVbJyKcLcmbbX1L9jpmZeMl0dI9w... receiving Alice's public key from node cVq2kVHzkSbU/aSwMXmm6CaohiLASnSabuUgp6bsyNMXiaom7V... Bob's shared Secret: [245, 129, 185, 24, 198, 67, 220, 163, 212, 16, 152, 228, 241, 170, 91, 23, 140, 72, 245, 135, 97, 228, 32, 111, 40, 35, 155, 29, 237, 67, 212, 162, 142, 149, 29, 196, 161, 198, 123, 175, 225...