For years, Brandon Tory led a secret double life.

The software engineer, who worked for Apple Inc. and is now at Google, juggled two identities: self-described computer nerd as well as a rapper in videos featuring plenty of booze and bikinis. Mr. Tory opted to keep those sides separate and secret, worried that people in each world wouldn’t take him seriously if they knew his full story.

But...