What a surprise.

https://english.stackexchange.com/questions/217196/origin-of-you-have-nothing-to-fear-if-you-have-nothing-to-hide

You have nothing to fear if you have nothing to hide.

The phrase - widely used in discussions of Internet security and uttered by Pius Thicknesse in Harry Potter and the Deathly Hallows - is most commonly attributed to Joseph Goebbels in 1933.

However, there is an earlier precedent. Upton Sinclair used an inverted version in 1918 in The Profits of Religion: An Essay in Economic Interpretation:

Not merely was my own mail opened, but the mail of all my relatives and friends—people residing in places as far apart as California and Florida. I recall the bland smile of a government official to whom I complained about this matter: ‘If you have nothing to hide you have nothing to fear.’