How to add custom encryption to gRPC?

659 views
Skip to first unread message

Constantine

unread,
Mar 6, 2017, 2:08:31 AM3/6/17
to grpc.io

I have a nodejs server and two android and ios clients. I want to use my own encryption method to encrypt data at clients and decrypt it at the server? I mean the following picture:




Is it possible?


Jan Tattermusch

unread,
Mar 6, 2017, 2:34:47 AM3/6/17
to Constantine, grpc.io
Hi, something like this can be implemented by changing the channel internals in gRPC C core. We have an API to add things like that, but expect you'll need a very good knowledge of how gRPC C core works to make this work.

Also, why do you need custom encryption at all? gRPC comes with SSL/TLS support built-in and I'd strongly recommend using it instead of trying to come up with your own custom solution.

--
You received this message because you are subscribed to the Google Groups "grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+unsubscribe@googlegroups.com.
To post to this group, send email to grp...@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/e24d1b71-8301-4a57-9b92-7aae1d6e895a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Constantine

unread,
Mar 6, 2017, 2:46:48 AM3/6/17
to grpc.io, sinae...@gmail.com
Hi Thank you :)
I don't have such knowledge, unfortunately.
We are using this for a simple chat application and we create a different key for each user through a KDF process. So all data will be encrypted and decrypted with this key for each user.

It will be good that we gRPC add a layer of custom encryption? (I don't know how hard it is or how much effort it will take.)


On Monday, March 6, 2017 at 11:04:47 AM UTC+3:30, Jan Tattermusch wrote:
Hi, something like this can be implemented by changing the channel internals in gRPC C core. We have an API to add things like that, but expect you'll need a very good knowledge of how gRPC C core works to make this work.

Also, why do you need custom encryption at all? gRPC comes with SSL/TLS support built-in and I'd strongly recommend using it instead of trying to come up with your own custom solution.
On Mon, Mar 6, 2017 at 8:08 AM, Constantine <sinae...@gmail.com> wrote:

I have a nodejs server and two android and ios clients. I want to use my own encryption method to encrypt data at clients and decrypt it at the server? I mean the following picture:




Is it possible?


--
You received this message because you are subscribed to the Google Groups "grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+u...@googlegroups.com.

Jan Tattermusch

unread,
Mar 6, 2017, 5:30:14 AM3/6/17
to Constantine, grpc.io
On Mon, Mar 6, 2017 at 8:46 AM, Constantine <sinae...@gmail.com> wrote:
Hi Thank you :)
I don't have such knowledge, unfortunately.
We are using this for a simple chat application and we create a different key for each user through a KDF process. So all data will be encrypted and decrypted with this key for each user.

In your case, you might want to basically encrypt the serialized protocol buffer messages. E.g.

message PlainChatMessage {
   string text = 1;
   int ....
}

// define your RPC request and responses using this message
message EncryptedChatMessage
{
   bytes encrypted_data = 1;
}

 

It will be good that we gRPC add a layer of custom encryption? (I don't know how hard it is or how much effort it will take.)

On Monday, March 6, 2017 at 11:04:47 AM UTC+3:30, Jan Tattermusch wrote:
Hi, something like this can be implemented by changing the channel internals in gRPC C core. We have an API to add things like that, but expect you'll need a very good knowledge of how gRPC C core works to make this work.

Also, why do you need custom encryption at all? gRPC comes with SSL/TLS support built-in and I'd strongly recommend using it instead of trying to come up with your own custom solution.

On Mon, Mar 6, 2017 at 8:08 AM, Constantine <sinae...@gmail.com> wrote:

I have a nodejs server and two android and ios clients. I want to use my own encryption method to encrypt data at clients and decrypt it at the server? I mean the following picture:




Is it possible?


--
You received this message because you are subscribed to the Google Groups "grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+u...@googlegroups.com.
To post to this group, send email to grp...@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/e24d1b71-8301-4a57-9b92-7aae1d6e895a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+unsubscribe@googlegroups.com.

To post to this group, send email to grp...@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.
Reply all
Reply to author
Forward
0 new messages