What is a good way to share encrypted files between users of a web platform?

Allow me to first sketch what I’m trying to achieve;
In my web platform, users should be able to create secured files and give certain other users the ability to read these files in case of an emergency (incapacitated, deceased, etc). In such a case the other user starts a process where the incapacitated user is informed and has a certain time period to prevent access (in case of misuse), after which the other user gains access to the file.
Requirements;

  • The file should be stored encrypted, and in case the server gets hacked, cannot be decrypted with just the information available on the server (ie a password is also needed to perform the decryption)
  • Communication should be secure (I know SSL is a thing, but I’d prefer to do all the encryption/decryption client side, so passwords cannot be caught by a man in the middle attack as they are never sent to the server in any way)
  • The creator of the file is in control over granting and revoking access to the file for other users.
  • The file can be updated after sharing without the need to grant access to the other users again.

I realize that this process has still some weaknesses for misuse (the time period to prevent access and communication about it can fail), but I don’t think these issues can be resolved with cryptography, so this is not part of my question.

I can’t seem to figure out a good strategy to encrypt the file and store the information in such a way that the requirements are met.

My initial thought was this;

  • User A creates the file and enters a password when saving

  • An RSA asymmetric keypair is generated (k1_priv, k1_pub), using the k1_pub to encrypt the file

  • Another asymmetric keypair is generated based on the password (k2_priv, k2_pub), using k2_pub to encrypt k1_priv issue 1

  • The encrypted file, encrypted k1_priv and k1_pub is sent to and saved on the server

  • User A can at any point open and change the file by entering his password to regenerate (k2_priv, k2_pub), using k2_priv to decrypt k1_priv

  • User A invites user B for access to the file. The invite is saved on the server and user B receives a link via e-mail to enter a password

  • An asymmetric keypair is generated (k3_priv, k3_pub), using k1_pub to encrypt k3_pub issue 1

  • The encrypted k3_pub is saved with the invitation and user A is informed

  • User A enters his password to regenerate (k2_priv, k2_pub), using k2_priv to decrypt k1_priv

  • k3_pub is decrypted using k1_priv

  • k1_priv is encrypted using k3_pub and saved with the invitation

  • User B asks access to the file; the timestamp is recorded and user A is informed

  • If user A does not intervene, user B can retrieve the encrypted file and the encrypted k1_priv stored with his invitation in the previous step

  • User B enters his password to regenerate (k3_priv, k3_pub), using k3_priv to decrypt k1_priv

  • The file is decrypted using k1_priv

My issues;

  1. As I’ve searched the internet for a way to do this, I see that this doesn’t really exist as it is a bad practice to generate a keypair based on a seed (the password), because it is easy to crack.
  2. Revoking access doesn’t really work after user B has had access to k1_priv at some point.

I would appreciate it if someone can point me into a direction that is both secure, adheres to the requirements, and is based on standard cryptography libraries/practices as I’m not experienced enough with cryptography to build it myself.
Alternatively I would also accept references to existing software that does this, as long as it is not too expensive (it will be used for ensuring continuity by a small volunteer organisation with limited budget)

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật