As far as im aware the prohibition of Shomer Negiah comes from two pesukim in ויקרא:
אִישׁ אִישׁ אֶל-כָּל-שְׁאֵר בְּשָׂרוֹ, לֹא תִקְרְבוּ לְגַלּוֹת עֶרְוָה: אֲנִי יְהוָה "None of you shall come near anyone of his own flesh to uncover nakedness: I am the Lord". (18:6)
וְאֶל-אִשָּׁה בְּנִדַּת טֻמְאָתָהּ--לֹא תִקְרַב לְגַלּוֹת עֶרְוָתָהּ "Do not come near a woman during her period of uncleanness (niddah) to uncover her nakedness". (18:19)
The second verse, which prohibits sex with a niddah (menstruating woman) applies not only to one's wife, but to all women, married or otherwise, because unmarried women are considered to be in a constant state of niddah because they do not go to mikvah (ritual immersion). The rabbis extended this prohibition beyond sex to include any type of touching, whether a handshake or a hug.
Is it possible to have sex with an unmarried woman if she went to mikvah?