kerberos-io / agent

An open and scalable video surveillance system for anyone making this world a better and more peaceful place.
https://kerberos.io
MIT License
692 stars 85 forks source link

Feature request: Multiple-level asymmetric encryption #33

Closed GHNewbiee closed 10 months ago

GHNewbiee commented 2 years ago

Nice to have such a feature, in the cunning times we live, for the (compressed) raw recording; for example:

cedricve commented 2 years ago

great idea! is there any specification for this? @GHNewbiee

GHNewbiee commented 2 years ago

Very sorry, I have only had the idea. I am not an IT folk. But it has to be implemented at the highest standards in order to be accepted by any state authority (eg police investigators, court, etc).

GHNewbiee commented 2 years ago

I have found some information about data streaming encryption:

Based on the information received from the above links, I would like to distinguish some matters which may clarify and simplify the scope of the feature.

In a few words, encryption and efficient long-time storage for probable display in the future is what we want!

For example:

I hope to have clarified better the idea of the feature I have suggested. Tia

cedricve commented 1 year ago

@GHNewbiee we started working on a lightweight form of encryption. See above PR for follow up #97

GHNewbiee commented 1 year ago

@cedricve Is chunking feature/requirement/operation, as described above, currently available? Tia

cedricve commented 1 year ago

Yes chunking is already there.

GHNewbiee commented 1 year ago

I do not know if there is a similar surveillance system with asymmetric encryption. If not, then a commercial term and a pic/logo would be given to it for marketing and trading reason. -:) For example: 3AKSS like HQ, HFS, HD, UHD, etc.

cedricve commented 1 year ago

Thanks for the feedback, so what we have been designing so far looks like this. We've implemented some mechanism to secure the keys as much.

encryption

We might tweak this more but so far the "encryption" key is only stored in the Kerberos Agent, and is shared in an encrypted form through Kerberos Vault and Kerberos Hub using a private key, non-stored passphrase and a time-lock for in-memory processing. Once the time window decryption is out-of-scope, the only way to decrypt the recording is by:

  1. Edge: Obtaining the encryption key of the agent
  2. Cloud: Obtain the private key of Kerberos Vault, intercept the passphrase of the user used for encryption/decryption of the shared key (which is not stored).
  3. Cloud: Obtain the private key of Kerberos Vault, intercept the shared key from memory in a time window of x minutes.
  4. Cloud: Man-in-the-middle attack in Kerberos Vault, obtaining access to the private key, and read incoming requests from memory.
GHNewbiee commented 1 year ago

Just a basic (silly) question: AFAIR/K, there are not consistent basic operations between pairs of asymmetric keys ie there are not operations ° and § for which PuK1° PuK2 <=> PrK1 § PrK2 is valid, aren't they? Hence, 2 or more public keys cannot be safely and operatably combined. Tia

cedricve commented 1 year ago

@GHNewbiee not sure if I understand your statement, or I'm missing some information. The whole point of two assymetric key pairs (kerberos agent and kerberos vault), is to encrypt messages in such a way we are sure they are the only one to decrypt the message. So hence create some level of trust between Kerberos Agent and Kerberos Vault. On the other hand we will not trust Kerberos Hub application, even if the users obtained access through password and MFA, hence the use of a non-stored passphrase.

On Kerberos Hub which is publicly accessible by any user (with the right credentials and MFA tokens), the encryption key is stored in an undecryptable format (you need both the passphrase and the private key of Kerberos Vault to obtain the encryption key).

GHNewbiee commented 1 year ago

Sorry for accidentally closing the issue. Writing from mobile is not my favorite activity at all.

My question had nothing to do with Kerberos Agent, Hub or Vault.

As I have already stated, I am not an IT folk and my knowledge is very limited. In fact, I cannot follow very close the technical matters regarding Kerberos Agent, Hub and Vault.

As long as multi asymmetric encryption will be supported, I would be very happy.

Private keys, if required, will only be taken and used by official state departments. Public keys of them (eg. national police, general prosecutor office, etc) can be found either directly online or retrieved by official servers.

I asked the question to see if multi encryption operation can be deducted to one by combining the public keys. For example. Three PuKs are used, mine, security company's and national police's ones. Data have to get encrypted 3 times in sequence. If there is a way these three public keys to be combined by giving one, then encryption will happen only once. In addition, increasing the security by adding extra PuKs (eg. general prosecutor office) will be much easier.

cedricve commented 10 months ago

Closing for now, as we have integrate end-to-end encryption. Not 100% matching the requirement in this issue by getting close. End user is able to bring their own keys, and encrypt their data. https://github.com/kerberos-io/agent#encryption