In an interview Wednesday with the U.S. television network ABC, Mr. Obama said countries would reciprocate if they saw any kind of responsible behavior from the North Korea. He said Pyongyang is yet to display that type of behavior.
North Korea has made a series of dramatic threats following last week's U.N. sanctions for its latest nuclear test. Among them is its vow to carry out a preemptive nuclear strike on the United States.
President Obama also told ABC that some, but not all, cyber attacks on U.S. firms and infrastructure originating in China were state sponsored.
He said the United States has told China and other countries it expects them to abide by international laws. He called for the U.S. Congress to strengthen cyber security while protecting civil liberties.
Earlier this week, U.S. National Security Advisor Tom Donilon urged China to take "serious steps" to stop cybercrimes.
Several large U.S. technology companies, including Apple, Facebook, and Twitter, were hacked earlier this year. The New York Times, Wall Street Journal, and Washington Post newspapers also say they were attacked.
U.S. Internet security group Mandiant has said Chinese military experts stole large amounts of data from about 150 U.S. companies and organizations. China denies the charge.
In addition to its threats, North Korea said last week it was canceling the armistice agreement that ended the Korean war in 1953. The United Nations has said the agreement is still valid. A U.N. spokesman said the terms of the deal do not allow North Korea or South Korea to end it unilaterally.
U.S. President Barack Obama is calling for North Korea to take "confidence building measures" aimed at diffusing tensions, such as ending its nuclear and missile testing.