Internet privacy with Next Generation IP tunneling protocol

You are interested in Internet privacy and You are using traditional old style IPsec or OpenVPN based tunneling protocols like IKEv1/IKEv2 or TLS which techologies coming from 90-ies. Big packet headers, lots of RTT-s, vast crypto libraries as openssl,  weak encryption algorithms and security issues. Look at my talk and presentation in Cyberchess2019 conference (in Latvian) and appreciate next generation IP tunneling protocol WireGuard and compare it against old style VPNs.  You could choose WireGuard clients as TunSafe for Windows 10, WARP from Cloudflare for Android and iOS with odd DoH/DoT! Good Luck!

Automatic SSL configuration generator

Configuring TLS is perhaps the most complicated and error-prone of all IT tasks, and this tries to make it as easy as possible. Mozilla recently developed and released SSL/TLS configuration generator

ssl-config.mozilla.org

Selfie reflection attack against TLS 1.3 with PSK(Pre-Shared Key)

This attack affect psk_ke and psk_dhe_psk key exchange modes. This attack don't compromise communication channel's confidentiality and integrity.

If Alice share key with Bob, Eve could redirect TLS handshake packets back to Alice and Alice will send data himself such as: "If you have the file data.txt you can delete it. I hold a copy." If Alice, Bob and Carol share same PSK and Alice send data to the Bob, Eve could redirect TLS traffic to the Carol. In such situation Alice don't know actually that she speaks withs Carol. Selfie authors recommends using external PSK in conjuction with certificates or enforce user identification, which isn't easy task. To avoid need to using certificattes Selfie authors recommend:

"A PSK MUST NOT be shared between more than one client and one server."

Actually here is question, how wide external PSK are used. As PSK avoid using public key operation, this is useful in performance-constrained environments with limited CPU power. From practial viewpoint Selfie attack affects very small percentage of TLS commmunity (who use TLS-PSK nowadays!):

- CDN nodes acting as proxies

- P2P networks

- WiFi networks relying on one PSK

Some notes on the security of Smart-ID

I familiarized with Smart-ID technical overview and pay attention to the signature computation. From quick overview of detailed description of signature scheme, I infer usage of Distributed Multiprime RSA composite signature (client and Smart-ID server). Brilliant idea ... but...

1. With outdated and flawed signature implementation with RSASSA-PKCS1-v1_5 from RFC 3447. Inventors of Distributed Multiprime RSA strongly discourage usage of such weak signature implementation: "In practice RSA is never used without a secure padding scheme, such as PSS-RSA for signatures or OAEP-RSA for encryption. As show by Bleichenbacker's attack [Ble98] on the PCKS#1 v1.5 standard, provable security of RSA in combination with the padding scheme is very important." Developers of Smart-ID signature scheme didn't follow to inventor's recommendations and best practices. Other security researchers also indicate RSASSA-PKCS1-v1_5 to be vulnerable to the side-channel attacks *).

2. Smart‑ID transport‑level protection with TLS 1.2 protocol based channels and certificate pinning is not sufficient. A more modern TLS 1.3 protocol version would be appropriate here (for migration to hybrid MLKEM768X25519 key exchange). Definetively, the use of semi‑static ECDHE key exchange within the TLS 1.2 protocol for rp-api.smart-id.com and mobile-api.smart-id.com, with a rotation interval of 1 hour and the same ECDHE keys being reused across all *.smart-id.com and *.smart-id.* domains, opens the door to key‑reuse attack vectors as analyzed by A. Menezes**) (section 2.3).

3. Moreover, the domains

mobile-api.smart-id.com

portal.smart-id.com

be.smart-id.com

reg.smart-id.com

rega.smart-id.com

smart-id.ee

smart-id.lv

smart-id.lt

etc.

use one and the same public/private key pair (despite having different certificates), which means that compromising any single site effectively compromises the TLS transport‑layer protection of the entire Smart‑ID domain ecosystem.


*) - https://people.redhat.com/~hkario/marvin/marvin-attack-paper.pdf

**) - https://cryptolounge.net/pdf/MU10.pdf

Android 9 uses weak DH-1024 key exchange in IKEv1 main phase for IPsec tunnels

I' m using Android 9 and iOS 12.2 mobile devices. I have deployed strongSwan 5.7.2 IPsec gateway with following default encryption and key exchange (marked as red) settings:

conn %default

ikelifetime=60m

keylife=20m

rekeymargin=3m

keyingtries=3

ike=aes256-aes128-sha256-sha1-x25519-ecp256-modp2048-modp1024

esp=aes256-aes128-sha256-sha1

rekey=no

I have configured 2 L2TP/IPsec connections on Android 9 device: L2TP/IPsec-psk with shared secret and L2TP/IPsec-cert with client and server X.509 certificates. As L2TP authentication and authorization server I used Xelerance xl2tpd 1.3.10. I was very surprised when my sudo ipsec statusall  returned  dh-1024 key exchange in IKEv1 main mode!:

l2tp-psk[3]: IKE proposal: AES_CBC_256/HMAC_SHA2_256_128/PRF_HMAC_SHA2_256/MODP_1024                                                                                                                        

l2tp-cert[6]: IKE proposal: AES_CBC_256/HMAC_SHA2_256_128/PRF_HMAC_SHA2_256/MODP_1024

When I configured IPsec XAUTH (Cisco VPN) tunnel establishment with client and server X.509 certificates, I got the same key exchange result!:

ikev1-xauth[4]: IKE proposal: AES_CBC_256/HMAC_SHA2_256_128/PRF_HMAC_SHA2_256/MODP_1024

iOS 12.2 with same client configuration uses, contrary Android 9, dh-2048 key exchange:

ikev1-xauth[1]: IKE proposal: AES_CBC_256/HMAC_SHA2_256_128/PRF_HMAC_SHA2_256/MODP_2048

l2tp-psk[5]: IKE proposal: AES_CBC_256/HMAC_SHA2_256_128/PRF_HMAC_SHA2_256/MODP_2048

It is worth mentioned that dh-1024 bit key exchange is considered as weak, since 2015. As built-in Android 9 IPsec VPN client key exchange are weak, my recommendation is to install strongSwan VPN Client 2.1.0  with IKEv2 and X25519 or ECC P-256 key exchange:

ikev2-eap-md5[2]: IKE proposal: AES_CBC_256/HMAC_SHA2_256_128/PRF_HMAC_SHA2_256/CURVE_25519

In Andoid 9 IPsec key exchange case, I should say: "Old bones in new bag".

Ultimately Google after couple of years of 'SOS calls' heard my voice and added red warning in Android 12 about  non-secure VPN connections with e.g. IPsec Xauth RSA and L2TP/IPsec RSA. Great!  MODP_1024 key exchange problem still exist. 

               Why (Not) to Use the Telegram App?  



I’ve heard repeated claims from the Telegram community itself, including its founder and CEO Mr. Pavel Durov, about Telegram’s high standards of privacy and security. In my opinion, these claims are based on several common myths, which I’ll attempt to debunk in the blog post below.

  1. Myth: Telegram provides end-to-end encryption (E2EE).
    By default, Telegram does not offer E2EE1)because it uses cloud-based chats. To enable “Secret Chat” mode in the app, you need to go through four steps and clicks. If you don’t do this, all conversations are decrypted on Telegram’s cloud servers using FFDH2)key exchange between the server and client. Moreover, you can only send E2EE messages when the recipient is online. Unlike Signal and WhatsApp, Telegram servers do not store encrypted messages for offline recipients.
  2. Myth: Group chats are secure and ensure group privacy.
    Group conversations also go through Telegram’s cloud servers, where they are decrypted and accessible to the service provider, thus not ensuring confidentiality within the group—unlike platforms such as WebEx.
  3. Myth: Telegram uses secure key agreement protocol and encryption algorithms.
    The current MTProto 2.0 protocol used in “Secret Chat” mode is considered relatively secure. However, the previous version (before 2014) had a serious vulnerability3)where Telegram servers could manipulate with DH key shares using a specially crafted nonces, making it impossible for end users to detect a Person-in-the-Middle (PitM) attack. This allowed Telegram to fully control message exchange between users. Although the vulnerability was fixed, distrust toward the protocol developers remains. Telegram uses the AES-256-IGE (Identity Garbled Extension) algorithm for encrypting transmitted data, which has known significant security weaknesses4). It’s unclear why the developers didn’t opt for cryptographically well-tested and widely adopted algorithms like AES-256-GCM or AES-256-CBC-HMAC.


So, is it worth using?
If you need a fast chat app and don’t mind that Telegram’s cloud has access to your phone number, contacts, SMS messages, location, and communication history, then Telegram is a great app and might suit you well.
However, if you’re a privacy enthusiast and treat privacy as a “holy grail,” then Telegram is definitely not for you.

 

Is XChat an end-to-end encryption protocol?

The XChat protocol is positioned by its owners as a pure end-to-end encrypted messaging protocol. But is it really? Matthew Garrett’s excellent blog1) post gives us a deeper look “under the hood”:


    1. Lack of Forward Secrecy. Similar to older versions of Threema (before March 19, 2023), unlike the Signal protocol which uses the double-ratchet mechanism to renew message encryption keys, XChat uses the recipient’s long-term public key for message encryption.
    2. User private keys stored on X servers. This provides certain convenience and advantages in case of device loss, since the user only needs to know their PIN code to restore access to XChat, i.e. to previously generated private keys. Logging in requires only the PIN code. This enables agentless access, for example via a web browser, similar to Meta’s Facebook Messenger and Instagram services. Of course, these services use Hardware Security Modules (HSMs).
    3. X’s key vault uses the “Juicebox” protocol2) to split key material and store fragments across servers. To reconstruct a user’s key, Shamir’s threshold scheme3) is used. If fragments are distributed across N servers, then at least M servers (M ≤ N) are required to reconstruct the key. XChat uses N=3. The cryptographic core of the Juicebox protocol is a threshold oblivious pseudorandom function4) (t-OPRF), essentially just an extension of OPRF5), which itself underpins OPAQUE (Asymmetric PAKE protocol, PAKE – Password Authenticated Key Exchange). XChat’s key vault service uses Entrust nShield SoloXC HSMs. Matthew Green also points out cryptographic vulnerabilities6) in the Juicebox protocol if the service provider is compromised. However, I cannot agree with Green’s view that OCS (Operator Card Set) management is trivial, since OCS management requires authorization with ACS (Administrator Card Set), which is a higher-level access.

Taking all of the above into account, XChat does not convincingly provide an end-to-end encrypted messaging service in the same way that Signal or Threema do. Moreover, storing user private keys on X servers is an easy target for persistent government requests for access to user communications.


1)mjg59 | Twitter's new encrypted DMs aren't better than the old ones

2)https://juicebox.xyz/assets/whitepapers/juiceboxprotocol_revision7_20230807.pdf

3) https://en.wikipedia.org/wiki/Shamir%27s_secret_sharing

4)https://datatracker.ietf.org/doc/rfc9497/

5)https://datatracker.ietf.org/doc/draft-krawczyk-cfrg-opaque/03/

6)A bit more on Twitter/X’s new encrypted messaging – A Few Thoughts on Cryptographic Engineering

E2EE goes under UK law enforcement 

The Signal, Threema and Wick developers are now hostile actors or more: someone who is developing an end-to-end encrypted messenger platform MAY unwittingly be considered a hostile actor against the UK?

https://assets.publishing.service.gov.uk/media/69411a3eadb5707d9f33d7e8/E03512978_-_Un-Act_The_National_Security_Act_in_2024_Accessible.pdf


 About latest data leakages in LV cyberspace

     Looking retrospectively at the data breaches that have occurred in Latvia’s cyberspace — including those at Latvian State Forests, the RTSD(Road Traffic Safety Directorate), the CRPC(Consumer Rights Protection Centre), and others — one inevitably begins to ask what has gone wrong.

On one hand, old vulnerabilities combined with AI give attackers new capabilities and a significant time advantage. On the other hand, strict multi‑factor authentication using eID cards, eParaksts Mobile, eID Scan, eIDAS or Smart‑ID, and confidentiality mechanisms such as on‑premises database encryption (TDE – Transparent Data Encryption, Always Encrypted SQL, etc.) or cloud‑based encryption with B/C/HYOK (Bring/Control/Hold Your Own Keys) key‑management models still fail to provide the necessary protection. The reason is simple: the protection of user data (encryption keys) is delegated to the system rather than entrusted to the user’s own competence.


     Let us consider the e‑address system. The e‑address — the official electronic address — is a personalized mailbox on the Latvija.gov.lv portal for unified and secure communication with state and municipal institutions. The e‑address system provides secure, efficient, and high‑quality e‑communication and e‑document exchange between government institutions and private individuals. It ensures data confidentiality and protects personal data from unauthorized access, unlawful processing or disclosure, accidental loss, alteration, or destruction.

For recipient identification, the system uses SSN (Social Security Number) for private individuals and RN (Registration Number) for legal entities. Such an identification system is highly suitable for individual user‑level data (correspondence) encryption, known as IBE (Identity‑Based Encryption).

      Let us examine a simplified IBE protocol called SAKKE (Sakai–Kasahara Key Exchange), which uses Tate bilinear pairing. The system (domain) has a single secret private key s and a corresponding domain public key P_pub = s·P (Fig. 1). The private key s is stored in the KMS (Key Management Server) inside an HSM (Hardware Security Module). Each user is assigned a private key D_ID = s·Q_ID, which is also stored in the HSM, similar to how eParaksts Mobile electronic signature keys are stored — except that access to the user’s key is granted not via a password but via one of the multi‑factor authentication methods mentioned above. To encrypt a message, the sender must know the recipient’s Q_ID (SSN or RN). The system generates a random value r and the corresponding public key R = r·P. Using the domain public key P_pub, the recipient’s Q_ID, and the one‑time random value r, the system derives a symmetric encryption key K, encrypts the message M to produce ciphertext C, then attaches the one‑time public key R and sends the pair (R, C) to the recipient (Fig. 2). The system deletes the session random value r. The recipient, using the multi‑factor authentication methods mentioned above, accesses their private key D_ID in the HSM and temporarily delegates it to the system for the session. The system then uses the received public key R and the user’s private key D_ID to derive the symmetric key K, decrypts the ciphertext C, and obtains the plaintext message M. After the session ends, both the message M and the private key D_ID are erased from system memory.


This scheme has several advantages:

  1. The user’s box stores messages (Ri, Ci) only in encrypted form. If the message database is compromised, there are no critical consequences — unlike in the RTSD case.
  2. No complex PKI infrastructure with certificate validity periods, revocation, etc.
  3. Easy delegation of rights to access one’s mailbox.
  4. In emergency situations, the system can access any mailbox content through an authorized key‑recovery operation.


     I would add that this protocol is used by UK government institutions, ministries, police, and fire services for internal information exchange under the name MIKEY‑SAKKE (Multimedia Internet KEYing SAKKE) using mobile communications.