TEHRAN — It’s a common theme in the state-controlled media in Iran: The armed forces are not to be trifled with; they’re tough men doing a tough job, defending a country permanently under threat. Nevertheless, it was a shock to some young Iranians when a video appeared featuring a well-known rapper delivering the same message from the deck of a navy frigate.

Things like chanting “death to America,” burning effigies of Uncle Sam and painting murals of Lady Liberty with a skull as a face lost their impact long ago, particularly among younger Iranians. Forced to adapt or fizzle out, Iran’s propaganda machine has sought to embrace the latest trends and technologies to try to tailor messages to the sensibilities of a new generation.

A number of such propaganda videos have appeared in recent years, distributed on Apparat, a local version of YouTube, as well as on the messenger app Telegram.