WASHINGTON — For more than five decades, the United States has found itself in periodic confrontation with two Communist nations that have survived on a diet of anti-Americanism, and defied the overwhelming odds that they would have collapsed years ago.

Now, in the same week, Cuba and North Korea have veered in entirely different directions, posing opposite challenges for the Obama administration. Cuba is now the newest experiment in integration, and North Korea a case study in how to contain an old adversary brandishing an entirely new weapon.

The Cuba question boils down to this: Now that President Obama has abandoned a policy of isolation that has failed for 53 years, what are the prospects of changing the nation the way the United States has tried to change China and Vietnam — the two former adversaries the president cited Wednesday as examples of successful engagement? In both cases, the idea is to lure such adversaries into adhering to Western-designed rules for dealing with the world, in return for the economic benefits of economic integration. In each case, it is still a work in progress.

North Korea, in contrast, has escalated its confrontation with the United States, but in a far more innovative way than building nuclear weapons or firing off missiles. Instead, it has turned to a new tool — easily deniable cyberattacks — and so provoked the White House that a spokesman said on Thursday that the United States was looking for a “proportional response.” But deterring cyberattacks from an isolated nation like North Korea is notoriously difficult — and in that battle, Kim Jong-un, the North’s leader, not only won the first round, but still holds a few cards.