The rapid expansion of Fifth Generation (5G) wireless communication networks has intensified the demand for reliable, intelligent, and secure spectrum management. Cognitive Radio Networks (CRNs) provide a promising solution through dynamic spectrum access; however, their performance is highly sensitive to sensing accuracy, adversarial behavior, and computational overhead. This paper proposes a Secure Machine-Learning-Driven Spectrum Sensing and Allocation framework that integrates lightweight cryptography and trust-aware fusion to enhance detection reliability and resource allocation efficiency. Machine learning is employed to extract discriminative features from energy statistics and predict primary-user activity, while lightweight cryptographic primitives ensure authentication, integrity, and confidentiality of sensing reports with minimal processing cost. A trust evaluation mechanism further mitigates the impact of malicious secondary users by adaptively weighting their contributions. Simulation results demonstrate that the proposed model achieves a detection probability of 0.90 at 10 dB, reduces false-alarm probability to 0.02, and improves system throughput by 12–15% compared to conventional greedy allocation. Lightweight cryptography reduces computation cost by 90%, enabling real-time secure operation. The combined results highlight the suitability of the proposed framework for large-scale, latency-constrained 5G CRNs, offering enhanced security, accuracy, and spectral efficiency.