Because strong encryption can be so effective, classified N.S.A. documents make clear, the agency's success depends on working with Internet companies - by getting their voluntary collaboration, forcing their cooperation with court orders or surreptitiously stealing their encryption keys or altering their software or hardware.