dik:
There are two "black boxes", actually international orange in color. They are usually located in the aft area of the aircraft for survivability. (Aircraft normally don't back into the earth!)
The flight data recorder records information about the aircraft systems and the cockpit voice recorder records sounds in the cockpit. Both of them typically operate from the aircraft primary electrical AC/DC systems, from electrical busses that are not shed in an emergency. But the black boxes are not typically independently powered. I say typically because while I have a LOT of experience with many airframes, I have not seen them all so I want to be careful not to assume too much.
And as you are probably thinking by now, yes a complete electrical system failure on the aircraft will render the black boxes dead and they stop recording.
IRstuff:
On the very slight chance dik may not know the acronym ULB, allow me to explain. ULB = Underwater Locator Beacon and it is battery powered as IRstuff indicates. If the black box is immersed in water, it activates the ULB to start broadcasting locator signals.
rb1957:
I am not an FAA person, but one question I might raise if I were was how could I insure that the transmitted data could not be altered by someone at the receiving end? The typically scenario for an aircraft crash is someone finds the "black box(es)" and gives them to the on scene FAA/NTSB authorities. The black box(es), or more correctly the data they contain are not reviewed by anyone that is not permitted by that authority.
I completely agree with you that technology allows what you suggest, but the regulatory authorities may not be ready to trust it yet.

)
And from the other side of the coin, you could say that the data is transmitted directly to an FAA reception point. But how many pilots do you know that would like the FAA to have a permanent record of every single control input and every single sound they made during a flight?

)

)
As a final caveat I will note that I am primarily describing transport category aircraft (airline aircraft) and not everything I said above necessarily applies to either military aircraft, business aircraft or general aviation.