Through confession, you would benefit spiritually - other than that no one else need know unless there is some legal or moral reason they should know. Father in Confession is bound by the secrecy of the Confessional. You can discuss the matter in full with Father in Confession which is secret and ask him if you are unsure re legal or moral grounds to reveal the matter.
We are only bound to confess mortal sin, venial sin is forgiven in very many ways indeed - and including in the Confessional. If you are unsure if the matter is venial or mortal, then you would need to discuss it with a priest either in the Confessional or by appointment.
I am sure that many would be distressed if something hidden or somethings hidden in their lives especially their past lives became general knowledge, I sure would be. Dont feel too alone in this.
TS