In a ruling that could have broad ramifications for law enforcement, a federal appeals court has found that a man under investigation for child pornography isn't required to unlock his computer hard drives for the federal government, because that act would amount to the man offering testimony against himself.

The ruling Thursday appears to be the first by a federal appeals court to find that a person can't be forced to turn over encyption codes or passwords in a criminal investigation, in light of the Fifth Amendment, which...