The Official Secrets Act of 1923 consolidates and amends laws relating to official secrets in India. It applies to all Indian citizens residing inside or outside the country, including government servants. The Act defines offenses related to spying, wrongful communication of official secrets, codes, passwords, sketches, plans, and other classified information. It aims to maintain national security by preventing the leakage of sensitive information to foreign powers that could harm India's sovereignty, security, or relations with other countries. Violations of the Act are punishable by imprisonment up to 14 years depending on the nature and context of the offense.