简体   繁体   English

Google云消息传递是否提供/支持身份验证,完整性和不可否认性?

[英]Does Google cloud messaging provide / support authentication, integrity and non repudiation?

I want to make sure that what I receive from the server, actually came from the server and was not tampered in transit. 我想确保我从服务器收到的内容实际上来自服务器,并且在运输过程中没有被篡改。 I have an application that send commands from a server to mobile devices. 我有一个将命令从服务器发送到移动设备的应用程序。 For power efficiency purposes, it would be nice to include that kind of payload into the GCM message. 为了提高功率效率,最好将这种有效载荷包含在GCM消息中。 However, it would be bad if someone tries to impersonate the server and send incorrect or malicious commands. 但是,如果有人尝试模拟服务器并发送不正确或恶意的命令,那将是很糟糕的。 I wonder if GCM provides mechanism to this respect, if just signing the messages would be enough or if it is better just to use GCM for waking up the application and then use another channel to receive the command, even if it consumes a small amount of extra energy. 我不知道GCM是否提供了这方面的机制,仅对消息签名就足够了,还是最好仅使用GCM唤醒应用程序,然后使用另一个通道来接收命令,即使它消耗了少量信息即可。额外的能量。

If you want to verify that the message came from the server, you should sign it with a private key from a public/private key pair. 如果要验证消息是否来自服务器,则应使用来自公用/专用密钥对的专用密钥对其进行签名。 You can then verify the signature in the client using the public key. 然后,您可以使用公钥在客户端中验证签名。 This way you know that the request came from the server (assuming your private key isn't compromised. Keep it safe!). 这样,您就知道请求来自服务器(假设您的私钥没有受到损害。请确保安全!)。 This is how Windows update works, as well APT and YUM. 这就是Windows更新以及APT和YUM的工作方式。

Note though, that this will only prevent someone impersonating your server. 但是请注意,这只会防止他人模仿您的服务器。 It won't encrypt the data, and it won't guarantee anything about the client. 它不会加密数据,也不能保证有关客户端的任何信息。 You can't do the same thing in reverse (sign client originating data with a client private key) because anything that comes from the client can be tampered with/spoofed or otherwise malicious. 您不能相反地做同样的事情(用客户端私钥对客户端原始数据进行签名),因为来自客户端的任何信息都可能被篡改/欺骗或以其他方式进行恶意篡改。 If you want the client information to be encrypted you can encrypt it with the servers public key and only the server's private key will decrypt it. 如果要对客户端信息进行加密,则可以使用服务器的公钥对其进行加密,只有服务器的私钥才能对其进行解密。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM