I have been using electrum wallet and I heard that there exist a wallet file... but what does exactly contains? the private keys?
I heard that there exist a wallet file
The default wallet file is called default_wallet, which is created when you first run the application and is located in the /wallets folder, inside the datadir.
what does exactly contains? the private keys?
It contains at least the seed and private keys
How is the wallet encrypted?
Electrum uses two separate levels of encryption:
Your seed and private keys are encrypted using AES-256-CBC. The private keys are decrypted only briefly, when you need to sign a transaction; for this you need to enter your password. This is done in order to minimize the amount of time during which sensitive information is unencrypted in your computer’s memory.
In addition, your wallet file may be encrypted on disk. Note that the wallet information will remain unencrypted in the memory of your computer for the duration of your session. If a wallet is encrypted, then its password will be required in order to open it. Note that the password will not be kept in memory; Electrum does not need it in order to save the wallet on disk, because it uses asymmetric encryption (ECIES).
Wallet file encryption is activated by default since version 2.8. It is intended to protect your privacy, but also to prevent you from requesting bitcoins on a wallet that you do not control.
From what I have read, from version 2 the Electrum wallet file is in JSON format - so should be readable with a text editor / viewer.
If you see nothing other than unreadable base64 text (
=), it means the wallet is encrypted.