Abstract Physical layer security can be considered to solve the security problem from the point of view of information theory in wireless networks. The combination of cryptographic schemes with channel coding techniques is called for in the basic principle of information-theoretic security. Due to the presence of one or more eavesdropper in wireless relay networks, secrecy of communication is in jeopardy. For such a scenario secrecy rate of the network provide a good measure of performance of the system. In this paper our focus is on secrecy capacity and its optimization with appropriate weight designs of relays taking into consideration the channels through which the eavesdroppers are connected to the relays. We propose the AF and DF based optimal beam forming scheme to improve the wireless security against eavesdropping attack by detecting and removing the eavesdroppers from the wireless relay networks and thus finding measures to maximize the efficiency, response time and the throughput of the system It includes an auto-regression technique as first approach and the use of RC6 algorithm for encrypting the confidential messages. The scheme is a two way approach that will not only provides security to the confidential messages, to be communicated within a wireless relay network in presence of multiple relays and eavesdroppers, but also it will deal with the saving the consumed power by detecting and removing the nodes which are malicious or defected which in turn will consume more power in order to perform malicious activity on the messages or may try to create interferences in the network. The eavesdropper nodes in the proposed system are considered to be working as relays so it may either be connected to source or destination directly or in between the relays. Keywords: Beamforming, Channel State Information, Eavesdropper Attack, Power Consumption, Secrecy Capacity.