STOCKHOLM—One of the co-founders of the file-sharing website The Pirate Bay has been sentenced to 3½ years in prison for illegally obtaining Danish criminal, drivers’ license and other sensitive records.

Gottfrid Svartholm Warg—known in hacking communities as “anakata”—was found guilty alongside an unnamed 21-year old Danish accomplice of hacking into systems operated by the Danish arm of Computer Sciences Corp. in 2012.

CSC...