MILLSTONE TOWNSHIP — A Monmouth County man has been sentenced to five years in prison after admitting that he hacked into more than a thousand email accounts to steal people's most intimate photos.

Patrick S. Farrell, 37, specifically pleaded guilty to second-degree computer theft by stealing the nude images of two women and then sharing the photos and video online.

State prosecutors say he targeted the women he did not know between October 2015 and April 2016 and hacked into their cloud-based storage accounts.

From one victim, he copied a sexual video and nude photos, posting the images on websites for others to look at.

Prosecutors said he took the stolen photos from the other victim and posted them on the woman's own social media account.

“Farrell violated the privacy of his two victims in a devastating way, leaving them fearful and insecure because their most intimate moments were exposed to family members, friends and total strangers,” said Attorney General Gurbir Grewal said in a prepared statement Thursday. “Beyond the incalculable emotional harm he inflicted, Farrell’s breaches left the information in the victims’ online accounts vulnerable to exploitation by other cybercriminals. This prison sentence sends a deterrent message that we will aggressively prosecute this type of crime.”

In court, Farrell admitted that he did this to countless other strangers.

In 2014, nude images of various celebrities were posted online after being stolen from their iCloud accounts, leading Apple to roll out two-factor authentication as a security option for users to access their accounts.

Experts recommend that cloud storage users make their passwords strong by coming up with 15-character strings of upper and lower-case letters, numbers and symbols — and writing it down on paper. In addition, users should opt for two-factor authentication, which will require someone trying to log in from a new device to enter the password as well as a random verification code that gets push-alerted or texted to a recognized device or phone number.

Sergio Bichao is deputy digital editor at New Jersey 101.5. Send him news tips: Call 609-359-5348 or email sergio.bichao@townsquaremedia.com.

Sign up for the NJ1015.com Newsletter

Get the best of NJ1015.com delivered to your inbox every day.