Here's a film that John Reid, our new home secretary, might care to check out over the weekend. Dr Reid is reportedly much vexed at the undue leniency being shown to paedophiles. There is not much in the way of leniency, undue or otherwise, in this claustrophobic horror thriller by British-born director David Slade, filmed mostly in extreme, panicky close-up. It's about a cute 14-year-old girl who is having a flirtatious chatroom relationship with a thirtysomething guy. She winds up being invited to his apartment for cocktails. One of them is being groomed; the other is a predator. Which is which?

Ellen Page gives a performance of awe-inspiring self-possession as the winsome and precocious American teen Hayley, totally into Goldfrapp and Zadie Smith, who strikes up a sexually charged online conversation with Jeff (Patrick Wilson), a successful fashion photographer in his early 30s. The movie opens with their pert web-borne insinuations. Jeff, it appears, has an icky habit of hanging out in chatrooms where the underage girls are to be found, checking out the names of unfamiliar bands mentioned, and, after he has had a minute or so to Google them, drops casual references into his conversation, thus impressing and utterly beguiling the web nymphets.

Hayley and Jeff take it to the next level by meeting for a coffee, and their bantering, seductive conversation becomes even more dangerous when she invites herself round to his way-cool bachelor pad and mixes them both some drinks. She giggles and simpers at his every joke and with icy, insolent provocation. Slade makes one thing clear: Hayley is trying very hard to be sexy - and is absolutely asking for it. But then Jeff puts his drink down, feeling woozy, and half an hour later, comes round from a drugged stupor to find himself tied up and naked from the waist down, and Hayley's manner has horribly changed. She is coldly sharpening up a scalpel belonging to her medic dad and reveals herself to be on a mission to punish chatroom paedophiles. The climax is a drawn-out scene that will have males crossing their legs and cringing. You could call Hayley jailbait, except jail looks very inviting compared to what she's getting ready for Jeff.

By flipping over our expectations about victim status and the paedophilia debate, Hard Candy keeps you off balance. Maybe plenty of people, paid-up liberals and others, have entertained dark revenge fantasies about child-molesters getting what's coming to them. But how would it look, moment by moment, if this revenge were to be carried out - and not on the victim's behalf, but by the would-be victim herself? Does the web itself create a febrile atmosphere that is a kind of cultural entrapment for men whose tendencies, before the internet was invented, might have lain dormant? And has our sexualised society blurred the boundaries of innocence?

Much of the drama consists in revealing and then obscuring exactly how high Jeff scores on the nonce-o-meter. He is clearly very creepy, and there is a peculiarly ghastly moment when he indulges Hayley's princess status by kissing her feet in the car park, prior to driving her back to his apartment. But he also looks like someone who is privately appalled at how out of his depth he is getting, and nervously keeps bringing up the fact that Hayley is underage. He could just be an idiot, who thought that the internet chatroom was a thrilling but safe arena of fantasy-realisation, with its own in-built prophylaxis.

Jeff certainly behaves like a very cool uncle, and that is what he basically believes himself to be: a likable, bohemian guy with a silly flaw: a predisposition for flirting with underage girls. But Blake reveals that it isn't as simple as that, and that there are photographs in Jeff's floor safe that he would prefer kept secret - and that he is in very serious denial about himself. Hayley's motives are themselves obscure. Hard Candy keeps you guessing until the end, with a few Hitchcockian jolts on the way, when a puzzled neighbour (Sandra Oh) shows up at the door, wondering what's going on in Jeff's flat.

It does have to be said that the movie does not turn out quite as hardcore as we'd been led to believe, and certainly not as hardcore as the film I suspect has inspired it, the now increasingly legendary Audition, by Japanese shockmeister Takashi Miike. Perhaps the central role-reversal of manipulation and violence obtusely misrepresents the actual power relations of sex abuse both in the real world and on the net. Hard Candy is a very well acted, provocative piece nonetheless, with an outstanding turn from Ellen Page. It is the kind of performance which, if you'll forgive the expression, takes balls.