Why not?
If you suitcase is locked they will ask politely (demand) that you open it - What is the difference?
Don't carry anything through a border that you don't want to be subject to search - saying "electronic" is different is muddying the waters.
The more interesting case comes where if you are carrying a device that has encrypted material for which you do not hold the key (for example it's a corporate laptop used by multiple people one of which has received an encrypted file).