Abdelkader Ait-Ouarabi, known as Gen Hassan, was convicted at a closed-door military tribunal on Thursday.
His lawyers described him as the victim of a ferocious clan war at the top of Algerian politics.
Gen Hassan played a leading role for two decades in Algeria's civil war.
Following the military's annulment of an election win by Islamists in 1992, Algeria's Intelligence and Security Directorate (DRS) was heavily involved in the conflict in which it is estimated that more than 150,000 people died.
Gen Hassan's imprisonment follows the sacking in September of Mohamed Mediene, who had led the DRS for 25 years.
President Abdelaziz Bouteflika has led a gradual purge in the country's security elite over the past two years, correspondents say.
Algeria's former counter-terrorism chief has been sentenced to five years in prison for destroying documents and disobeying military orders, the APS state news agency reports.