The navy “launched a cyber-attack against the computer network of the defensive forces in order to infiltrate the network and hack information or spread virus,” the English-language Iran daily reported, quoting Rear Admiral Amir Rastegari.
Rastegari said the cyber-attack was successfully detected and blocked.
Over the past three years, Iranian industrial facilities including oil and nuclear sites, as well as communications networks and banking systems have all come under cyber-attacks blamed on the United States and regional arch-foe Israel.
Tehran says it has developed civil and military cyber units to counter such attacks.
Naval forces of the elite Revolutionary Guards have been engaged in a military drill in the Strait of Hormuz as well as in the Gulf of Oman for the past week.
Iranian military officials say the exercises are aimed at demonstrating Tehran’s “defensive naval capabilities... and sending a message of peace and friendship to regional countries.”
Submarines are taking part in the drills in which several missile systems are being tested, Iranian media reported.
Military officials have said that the maneuvers were not aimed at closing the strategic Strait of Hormuz waterway through which much of the world’s oil supply passes.
The drills come as the West increases its pressure over Iran’s nuclear program. The West suspects it may be aimed at producing nuclear weapons, a charge Iran denies.
Iran has previously threatened to close the straits over Western sanctions.
Last year, Iran held a similar drill that lasted 10 days. On September 2012, it launched a destroyer and submarine to the Arab Gulf in the same time the United States and its allies conducted naval exercises to find ways to keep the strait open for oil cargo shipments.
A heavy Western naval presence in the Gulf is meant to deter any attempt to block the waterway.