Hacking has been portrayed through different ways in games. We have games that are hacking simulators like Uplink, which is the most famous and, in my opinion, the best, even if there are a ton of inaccuracies concerning actual hacking, and then we have RPGs, FPSs, and hybrids, that implement hacking as one of the various actions that you can do. I'll focus on these.
In Fallout 3, there's a table of words with randomized characters, and you get a number of attempts to select the word on the list that might be the password. Failing all of those attempts means you need a key, ALWAYS found somewhere in the area. Which doesn't sound so good. Again, a minigame.
It seems the status quo is to implement hacking as a minigame, which to me is unfortunate.
Hacking should have some form of flavouring, it doesn't have to be text and it doesn't have to reference something like ICE, but the player should feel like he is performing a felony, a crime, something forbidden, and also something technical. Characters should react to seeing the character hacking, and order him to stop or attack him. It should be viewed as stealing an NPC's items or going into restricted areas. It shouldn't be accessible to anyone, as it should require investment from the player, and it should get easier/harder with time. Different objects or functions could be hacked through different systems, and more secure systems should be significantly harder to hack.