Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(privacy): use constant timestamp in Fernet ciphertext #466

Merged
merged 2 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions docs/PRIVACY.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ id: 1
username: scidsg
display_name: Science & Design
password_hash: gAAAAABlmgU-WeEuGr7b-HlwHJ5pIzxD3g9hLPStc8kUBZMiKyFVnj66Um6H4Sz2STfG6W8VBTP2zO2cG19ofqmdfQolx_Da6m_X3lHUajdlh1yp1alf_BoAoBvMxPUDkDRrrUWuaR1T0fJYeXY-C63ulfN6F2oCmQ==
totp_secret: gAAAAABlmgXSWumslIWNS7FEEAjf6nFqyeamKYTf0dmwnIUIRaLTzDcgDHeHimST4Lb3eIUwu-8fRVT9kiiSb3igbh-tANjLEIQV2E8ohkEPwmCJ8_wYR3ediBsGaTWMQHaIykV3sznk
email: gAAAAABlmjX3GyR8cJ03-MbSb7E3ozM10I_hDA4E22GmUxibQFLsI92lbKDwcMpXwGt_kZnJZgorMhpplbRPFHvytnL0aJOnrejkrua2YVwhrsuu0GwK8GA=
smtp_server: gAAAAABlmjX31SvRZLqFxdTPb0mTVdi9Hm6YJwnqItRNlcZKsJZGkSp55H4AkInkVblzyCyYuB0C4JCkzYVnuXQXt5TqTDiNPw==
totp_secret: gAAAAAAAAAAAWumslIWNS7FEEAjf6nFqyeamKYTf0dmwnIUIRaLTzDcgDHeHimST4Lb3eIUwu-8fRVT9kiiSb3igbh-tANjLEIQV2E8ohkEPwmCJ8_wYR3ediBsGaTWMQHaIykV3sznk
email: gAAAAAAAAAAAGyR8cJ03-MbSb7E3ozM10I_hDA4E22GmUxibQFLsI92lbKDwcMpXwGt_kZnJZgorMhpplbRPFHvytnL0aJOnrejkrua2YVwhrsuu0GwK8GA=
smtp_server: gAAAAAAAAAAA1SvRZLqFxdTPb0mTVdi9Hm6YJwnqItRNlcZKsJZGkSp55H4AkInkVblzyCyYuB0C4JCkzYVnuXQXt5TqTDiNPw==
smtp_port: 587
smtp_username: gAAAAABlmjX3SFNOr6xkrHtVMUTmcbzDKKAvWaGEXZstusPPrRKFTjgeBOXdFmClmxvZ50yU7uSXT2-yzhMqQS-yaSh7qJUSqxizMP36rxRhT_6qPuhECq0=
smtp_password: gAAAAABlmjX3tJFpAFZkFcXbF2PfN9sDMinQ-GG0DO2-AO_2b9OeMtzlDwO5jPhZs-u0_hjjKip7b09r0QPAK89hfOuMsJOleG9HVif2sjiDiVDZj4_OyRY=
pgp_key: gAAAAABlmjNMojyYZexHGNf_CRJhkSXz_QqZ45VAbN7XetrP5_xA81bJAuonMdpIxTVpB57wddZjLbY8gyZb4pDQ8aTntup93tCD99VKKYTpKSQyVe6K9CsRMx4YtB2E-rvfm78fuCgW0w1GGYCAUNI2hWZ_GvlMiZBkH8_p4FDIoN61WqPoVy1U2JasrJ3KJjhGaRTb4VQNUSai0crtUcXEMYZRYms9wGwin0bcygz8s9D2WQL7Iq-gggX1xOF4BpficvbBAd_ruddXtLKbDQLa_jylig_YaWrbc-qCjZEatpefl7yZVY1V7oXuuDHDAho8zn4o6tNgcBPW2KRBnhVI3N6QbCaCkuyE4I8VhXgvnXlZB8j4koB0k_lry8CzND83MMHDH1YS3InqZcPT9lUrKhGHxD2yVSwpUzNOrI8_V0V47UFwpstiSOCowfOLY2RTvol1G_005Lar9X3CnPruijSxMKEafd7SW_EP-iXn6ORE1wW2Hu63T3XCK6OR80kL6QgUIwLVsC_BRgJUq9TGFiE7mWdp7PDOFoSFiZtC2RbWOFqiBv10q9YazKlCi8MloWD6VcZc8rLPc-WOEpBlnqX38UgCGN5cHN2N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ISh33e0K4YJCHnrek0-w14EVAVGQ2q8hH9HB8OHnpxumZ_0HcQH1zT6OqQ9wuDX3gL2NqHsMeyNKqIeF75Nh6ym01CAN5r57B-gPquATc5G-lkeAl1I8DS-AaZn8rq0pEK-gP_fDd_Kd-kSYAqVG3XA0IW8WcgwGwTI0wvfOVxTkfv0w7BeoTq5UcPJMCEHxLT35KLt66mjXZRpX8F_Jz32nvBgVsjlM9YyEnQ5WiRPblntS2Q-bcVCfzdrMKYZ5Zlq-EYiB10o-qPSvz5x2k2vD8Q3aa4unpWRVqG3AQB_QSdgzSY4NaBn4H6hWk32l3_CQo9JfTlEhbOb08lPv6iiTR84t_iqHvhzkLSpX_I3Rv1EgTvND_C81X3ALDbViJV5DgdqpPIf69kYTj0OLOx8WSeUVyDldFlb9q-xFKmbfLqC1IM6-zRCxl0Sh5urr6R3oAqCFmCvGj-gYOQigtP5w3AcbSN82Zuw6BLOjq0z0rSGMnMqsL6ldtYvUBD0ECgRgVhXNGTqFi79V9iUYmQc_9Bmdwvfy9nTsAAuxHz6zW7QX7L4wrKEzbs7TaX5e1rjdW2OuUhNdDzPNsgdgJAcz_NU7EtCB_dTKGDAvvLzmvTduThVGDXigBuC5sVC8x9991OtmGel-fGcrS9vvpCkhH2JyWo9IgzRgi-RlD-Aro_1ocnFoN94_8cC2tzMgju8faRksOayXbuTq0QIvWBQA8nH8bVv2CboYCMDt2O1glp3UJRghONjFaiQ8r7ypYREy2uFsQ847BESBksTizFs81tLOMYVVJVnNeDSlxMG9Ie2B1CxYcRvraUiqHeEcAZoISUQ61KTXaK9N7dugdiPi__rE6cSVcXk8FhXvD6yDEbF9-8TFfPj-PnarNzOUzXNPOtjYxgnd1xir2LuNk6ocKxUs4AZlhHcVB1UhS3bINN36n
is_verified: True
```

Expand Down
4 changes: 3 additions & 1 deletion hushline/crypto.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ def encrypt_field(data: bytes | str | None) -> str | None:
# If data is a string, encode it to bytes
data = data.encode()

return fernet.encrypt(data).decode()
# We explicitly set the current time to 0 to avoid storing timestamps
# that could be used to de-anonymize user-activity per the threat model.
return fernet.encrypt_at_time(data, current_time=0).decode()
rmlibre marked this conversation as resolved.
Show resolved Hide resolved


def decrypt_field(data: str | None) -> str | None:
Expand Down