John B. Ewald Jr., 59, a retired logistics specialist with the National Security Agency, died of cancer Friday at Anne Arundel General Hospital in Annapolis.

He joined NSA in about 1956 and retired in 1972. Since then he had been active in real estate and was a member of the Anne Arundel County Real Estate Board.

Mr. Ewald was born in Charleston, S.C., the son of a Navy officer. He was a graduate of Georgia Institute of Technology in Atlanta. He served with the U.S. Army in World War II, seeing duty in the Philippines.

After the war, he joined the Naval Reserve and was recalled to active duty during the Korean conflict, serving at the Pentagon. During the early 1950s he was executive assistant to Anna Rosenberg, assistant secretary of defense for manpower.

Mr. Ewald was a member of the Meade Modelers Radio-Controlled Airplane Club and the Sailing Club of the Chesapeake.

He is survived by his wife, the former Virginia Reynolds, of the home in Sherwood Forest near Annapolis; a daughter. Mrs. Joseph C. Wich Jr., of Towson, Md.; two sons, Walter W. and John B. III, both of Laurel; a sister, Mrs. M. Laughin MacDonald, of Raeford, N.C., and a brother, Harry A. H., of Annapolis.