The optimal deployment of service functional chains in the dark cloud computing environment faces several challenges, including data confidentiality, resource dynamics, and quality of service assurance. In this paper, a dynamic programming (DP) model for SFC deployment is proposed that simultaneously optimizes operational cost, latency, and security. By formulating the problem as a multi-stage decision-making process, the proposed model provides an efficient solution for resource allocation under dark cloud security constraints. Simulation results show that this method achieves a 25% cost reduction and a 20% improvement in security performance compared with conventional algorithms (such as greedy and genetic methods). Dark cloud computing deploys services at the edge of the network to overcome the limitations of centralized cloud systems. However, the use of these concepts is still in its infancy, and there are many challenges in dark cloud computing-based networks. One of these challenges is SFC, which uses network software instances to share resources. Network function virtualization technology separates the middleware hardware and runs them as virtual network functions on centralized nodes. VNFs are sequentially connected to each other in service function chains. Deploying VNFs in a dark cloud computing network is a complex problem and requires optimal resource utilization and reduced latency and cost. In this paper, the SFC deployment problem is addressed by using deep reinforcement learning and VNF reuse. The proposed algorithm balances cost and quality of service by considering resource constraints and analyzing the dynamic distribution of VNFs.