We used to burn C4 to heat water when I was in the Army. Just break it up into smaller crumbs and light it with a match. It burns real hot so there's a risk of it burning out the bottom of your steal cup. (It will not explode without a shock wave)
I wouldn't try the same thing with old school dynamite.