When considering how to secure files and accounts, adding a password for access is often the first thought. Although Google Sheets does not have this as a default feature, it can be achieved using Google Apps Script. Learn how to achieve this by following this tutorial.
Can I Password Protect Google Sheets?
At first glance, it may seem impossible to password-protect a Google Sheets spreadsheet. This is because Google Sheets does not have a built-in password feature. Instead, it has a Share feature that allows you to control which Google accounts have access to the data.
However, as we have seen in other tutorials, you can add additional features to google sheets using Google Apps Script. This is what we will use in this tutorial.
Why provide an additional layer of protection?
Certain sheets may contain sensitive data such as login information, bank information, earnings, etc. if the account used is shared, adding this kind of functionality to the Google Sheets spreadsheet will make sure that even if the account is compromised, there is still a layer of protection that keeps the data from being accessed.
How to Protect Google Sheets with Password
Step 1: Open the Google Sheets template
Click the link below to open the template:
Step 2: Copy the template to your Google Sheets
The link prompts you to make a copy the sheet alongside its Apps Script files and functionality. Click
Make a copy. Google Sheets Copy document prompt Step 3: Open Google Sheets Apps Script
To open Google Apps Script, click
Extensions on the main toolbar then select Apps Script. Access Google Apps Script through Extensions in Google Sheets Step 4: Start New deployment
Click the arrow besides the
Deploy button, then select New deployment Google Sheets Apps Script, Deploy, new deployment Step 5: Deploy the Script
A box will appear allowing you to configure the deployment. We can opt not to modify these settings. Click
Deploy. New deployment options Step 6: Authorize Access to Apps Script
As you will run the script for the first time, Google Apps Script will prompt you to Authorize Access to the script. Click
Authorize access. Google Sheets Authorize access to custom Apps Script
A new window will appear, prompting you to select the Google account to authorize. Select your account.
Choose account for access authorization
A page will load, inform you that the app has not been verified by Google. This app is however safe.
Google hasn't verified this app
Advanced, then click Go to ProtectedSheet. Click link on the lower portion of the page to continue using the app
You will be brought next to the page containing lists of permissions required to run the app. Click
Allow. List of permissions needed by the app in Google Step 7: Click Done
The window will close and you will be brought back to the
New deployment box. Click Done. New deployment box with generated web app link Step 8: Click Protect File, then Initialize Google Sheets Protect File, Initialize option
A small box labeled
Finished script indicates that the script has been initialized. We are now ready to add contents to this spreadsheet and encrypt it. Finished script notification, means script has initialized in your Google Sheets
You can now start adding data to the spreadsheet. It is best to store the data starting at Row 3. You will see in the next section why.
Data added to the sheet Set a Password to Encrypt Data
When you encrypt the data for the first time, you will be asked to supply a password. Here are the steps:
Initial data, unencrypted Step 1: Click Protect File Step 2: Select Encrypt File Google Sheets Protect File, Encrypt file option Step 3: Set a new password Create a new password box
Step 4: Click Ok
The data will become encrypted starting Row 3.
Google Sheets Data after encrypting it. Note the random characters that obscure the content.
The same steps are still applicable if you want to encrypt data again.
Enter your password to encrypt data
How to Unlock/Decrypt Data
Here are the steps to decrypt the data:
Step 1: Click Protect File Step 2: Select Decrypt File Google Sheets Protect file, Decrypt file option Step 3: Enter the Password Enter password to decrypt Message if incorrect phrase is entered
Step 4: Click Enter.
You will see the data decrypted in action.
Decrypted data How to Change Password
Doing this process can be a necessity, especially if there are changes to those who access the accounts. Here are the steps to replace the old one with a new one.
Step 1: Click Protect File Step 2: Select Change Password Google Sheets Protect File, Change Password prompt Step 3: Replace the old one with a new one Change password box Step 4: Click Submit
Follow the steps to encrypt the data in the previous sections to activate the new settings.
Data after encrypting it again