CHICAGO (AP) _ Illinois Attorney General Jim Ryan said Tuesday his office will investigate a videotape which reportedly shows mass murderer Richard Speck having sex with other inmates and boasting of drug use inside prison.

His office also will address allegations against the state prison system that male guards at one facility had sex with female inmates and that gang members have had free rein while imprisoned.

``Our criminal laws need to be enforced both inside and outside prison walls,'' Ryan said.

Excerpts of the videotape, made in Stateville Correctional Center in 1988, were broadcast last week by WBBM-TV.

``If they only knew how much fun I was having in here, they would turn me loose,'' Speck said on the tape, which showed him snorting a white powder that appears to be cocaine and stripping off a prison jumpsuit to reveal blue women's underwear.

Bill Kurtis, the WBBM-TV reporter who has the videotape, said sections not broadcast show Speck having sex with other inmates.

Speck also discussed how and why he killed eight student nurses in 1966. He died of a heart attack in 1991 while serving a life sentence.

The tape apparently was recorded by Speck and two other inmates who sneaked into an area with video equipment reserved for staff training.

Members of the Illinois General Assembly planned the first of a series of hearings on the tapes for Wednesday.