I have a problem where we are using ServiceStack's Redis implementation for multi server caching and messaging via server sent events. As part of our security protocol, we are required to encrypt the data going into Redis. I was wondering if anyone has done this in past and what was their experience? Is there an easy way to do it or do we have to write our custom Redis Implementation? If it helps we are using Redis on Azure.
Asked
Active
Viewed 133 times
1 Answers
0
You shouldn't have to write a Custom Redis client but you would need to use ServiceStack.Redis raw IRedisNativeClient API in order to be able to store encrypted byte[]
values. The RedisClient
inherits from RedisNativeClient
which you can cast to in order to access the low-level byte[]
API, e.g:
using (var redis = clientsManager.GetClient())
{
var redisNative = (RedisNativeClient)redis;
}
ServiceStack also has a high-level CryptUtils available in its ServiceStack.Client library which provides an easy API to encrypt values using AES or RSA encryption.

mythz
- 141,670
- 29
- 246
- 390
-
@zaph it can be used for small payloads, also the Crypt Utils can be used to implement [RSA and AES Hybrid Encrypt then MAC](http://docs.servicestack.net/encrypted-messaging#rsa-and-aes-hybrid-encryption-verified-with-hmac-sha-256) encryption for larger payloads. I didn't specify the encryption strategy only that the Crypt Utils contains high-level utils that can help. – mythz Jul 05 '17 at 21:37