Michael Daniel Rubens was merely an acquaintance — if that — to many of his victims. He worked in the same building as a few, his ex-girlfriend worked with another, and he went to high school with (but never talked to) two more.

The tenuous connections, though, didn’t stop Rubens from scouring the Internet to learn everything he could about the women — their favorite movies, their high school mascots, their pets and their parents’ maiden names. And with that personal data, the 31-year-old man was able to take over the women’s social media accounts, which he used to create and disseminate intimate and pornographic images of them.

On Tuesday, a federal judge sentenced Rubens to 10 years in federal prison. He had pleaded guilty late last year to cyberstalking, unauthorized access to a protected computer and aggravated identity theft in a case that seems to represent a particularly egregious example of social engineering and social media mayhem.

“This sentence sends an unequivocal message to anyone tempted to use a computer as a weapon to victimize and steal the identities of others: Expect to be prosecuted. And expect to go to prison,” Christopher P. Canova, acting U.S. attorney for the Northern District of Florida, said in a statement.

Prosecutors asserted that Rubens’s hacking spanned at least three years and affected a dozen or more people, damaging their personal relationships and driving some off of social media entirely. According to court records, Rubens, operating mostly from his Tallahassee home, sometimes posed as his victims and corresponded directly with people close to them. He was arrested in January 2015.

Court records show that in one instance, Rubens found the Facebook profile of someone who worked in the same building as him, then figured out her Yahoo email address and password. He found naked pictures that the woman had sent to her husband, who was deployed overseas, the records show. He posted them online, and someone eventually recognized her, the records show.

Rubens victimized another woman who worked in the same building that he did by posting doctored and intimate images of her on her mother’s Facebook account, the records show. And in a separate instance, the records show, he hacked into the account of his ex-girlfriend’s co-worker’s sister, then posted a doctored image of the co-worker performing oral sex. Rubens also corresponded with the co-worker’s 15-year-old nephew and shared the image with him, the records show.

Tor J. Friedman, Rubens’s attorney, wrote in a court filing that his client’s conduct “started as a curiosity to see what he could find out about someone through their online presence” and that he targeted “not necessarily friends or acquaintances but just individuals whose name[s] he knew, who he felt were attractive.” He wrote that Rubens, who was raised primarily by his mother, “never really had many friends growing up” and that might be why he turned to the Internet. He asserted that Rubens had accepted responsibility for his actions.

“It appears that Mr. Rubens has a difficult time in connecting with anyone in the real world and he used the escapism of being online as a poor substitute to actual human connection,” Friedman wrote.

The lawyer wrote that Rubens, who went to Syracuse University and has a master’s degree in business administration from Florida State University, relocated to Maine after his arrest and was working most recently in a retail store. Friedman did not immediately return a phone message seeking comment.