Document Key
Windows 10 & 11 Buy license · $29.95
How-to

How to Encrypt Files Before Uploading Them to OneDrive, Dropbox or Google Drive

Cloud storage is encrypted, but the provider holds the keys. Learn how to encrypt files before uploading to cloud storage so only you hold the password.

Updated 5 minute read The Document Key team

OneDrive, Dropbox and Google Drive already encrypt your files in transit and on their servers, but they hold the keys, so anyone who gets into your account, or the provider itself, can read them. To encrypt files before uploading to cloud storage, encrypt them on your PC with a password only you know, then save only the encrypted versions into your cloud folder. The sync works as normal, but what is stored online is unreadable without your password. The trade-off is that you cannot preview, search or open those files in the web browser or phone app.

This guide explains when it is worth doing, three practical ways to do it on Windows, and the mistakes that leave unencrypted copies in the cloud anyway.

Why encrypt files the cloud already encrypts?

Cloud providers encrypt data so that a stolen server disk or an intercepted connection does not expose your files. That is valuable, but the service still decrypts your files whenever you, or anyone signed in as you, asks for them. Encrypting before upload protects against a different set of risks:

  • Account takeover. A phished or reused password gives an attacker everything in your cloud storage. Pre-encrypted files are useless to them.
  • Sharing mistakes. A folder shared with the wrong person, or a share link that gets forwarded, exposes only scrambled files.
  • Every synced device. Your files sync to each PC, laptop and phone signed in to the account. If one of those devices is lost or shared, encrypted files stay protected.
  • The provider itself. Files are scanned, indexed and processed by the service. Pre-encrypted files give it nothing to read.

You do not need to do this for everything. It makes sense for tax returns, ID scans, medical records, legal documents, client files and anything else you would not want a stranger to read.

What you give up

Be clear about the trade-offs before you start:

FeatureNormal cloud fileEncrypted before upload
Syncs between your PCsYesYes
Preview in the web browserYesNo
Search inside the fileYesNo
Open on a phoneYesOnly with a compatible app
Edit together with others onlineYesNo
Readable if your account is breachedYesNo

A common approach is to keep everyday files normal and encrypt only one "private" folder.

Three ways to do it on Windows

1. Encrypt individual files in your cloud folder

File-level encryption is the most flexible option. Each file is encrypted separately, so when you change one file, only that file syncs again.

With Document Key, you right-click a file or folder and choose Encrypt. Files are locked with AES-256 and your password, and they stay encrypted wherever you put them, including OneDrive, Dropbox and Google Drive folders. You open a file on your PC by double-clicking it and entering the password. Everything happens on your PC, with no Document Key account or cloud service involved.

2. Upload AES-256 encrypted ZIP archives

For records you archive and rarely open, such as completed tax years, an AES-256 ZIP works well. It can be opened with the password on most computers, which is handy if you ever need it on a machine without your usual software. File names inside the ZIP stay visible, so rename sensitive files first. See how to password protect a ZIP file in Windows.

3. Use an encrypted container file

An encrypted container is one large file that mounts as a drive when unlocked. It hides file names as well as contents. The downside with cloud sync is size: depending on your provider, a change to one small file inside can mean syncing a large container again, and a container that is open on two PCs at once can end up with conflicting copies.

Step by step: setting up an encrypted cloud folder

  1. Create a folder for sensitive files outside your cloud folder, for example in Documents, if Documents is not synced.
  2. Move or copy the sensitive files there and encrypt them.
  3. Check that you can open an encrypted file with your password.
  4. Move the encrypted files into your OneDrive, Dropbox or Google Drive folder.
  5. Securely delete the unencrypted originals from your PC.
  6. Sign in to the cloud service in a browser and confirm the files there cannot be previewed.

Encrypting outside the cloud folder first matters, because of the next point.

The version history trap

If you encrypt a file that is already inside a synced folder, the cloud service usually keeps the previous unencrypted version in its version history, and the original may also end up in the online recycle bin. Your "encrypted" file then has a readable copy sitting right behind it.

After encrypting files that were already synced:

  • Open the service's version history for each sensitive file and delete older versions, where the service allows it.
  • Empty the online recycle bin, not just the one on your PC.
  • Check other devices that synced the files, and shared folders other people may have copied from.

Doing the encryption before files ever enter the cloud folder avoids all of this.

Keep the password out of the cloud

Encryption only helps if the password is not stored next to the files. Do not keep a "passwords.txt" in the same cloud account. Use a password manager with its own strong master password, and keep a printed recovery key at home. If you share the cloud account or folder with someone else, give them the password by phone or in person, never in a file in that folder. Our guide to creating a strong password for encryption covers the rest.

Sharing encrypted files from the cloud

Pre-encrypted files are also a safer way to share. Instead of sharing a readable folder, upload an encrypted file or package and send the link, then send the password separately. If the link is forwarded or the share is left open, the file is still protected. Document Key's secure sharing packages can be self-opening, so the recipient does not need the software, and can carry an expiry date. Our guide on sending large files securely walks through this.

Turn on two-step verification for your cloud account as well. Pre-encryption protects your most sensitive files; two-step verification protects everything else in the account.

Frequently asked questions

Is OneDrive or Google Drive already encrypted?

Yes, the major services encrypt files in transit and on their servers, but they manage the keys. Encrypting before upload means the files are unreadable without your password, even to the provider.

Can I still sync encrypted files?

Yes. An encrypted file syncs like any other file. You just cannot preview or edit it in the web browser or phone app.

What if I need the files on my phone?

Files encrypted by a Windows app need that app or a compatible tool to open them, so keep phone-friendly copies only of things that are not sensitive.

Get three guides like this every month, plus software update notices.Subscribe →