The shadowy secret life of Illinois' most popular Republican, a man who harbors ambitions of winning a Senate seat here in November, is being held up to a blistering light in a U.S. District courtroom here.

The discovery of two safe deposit boxes stuffed with almost $50,000 in cash has led to the indictment of Attorney General William J. Scott on charges of federal tax evasion and may prove his political undoing.

Dorothy Humphrey, former wife of the four-term incumbent, has testified that she was "stunned" to discover "bulky" envelops of cash when she rummaged through the two bank boxes they held jointly nearly a dozen years ago.

She said Scott later told her the money had accumulated from campaign contributions.

But the government says Scott used the cash to finance his living expenses and extravagant globe-trotting, and charged he filed false income tax returns between 1972 and 1975.

In the words of one prosecutor, Scott "lived out of a safety deposit box instead of his paychecks."

The sensational testimony in the three-week case has underscored the political complexion of the trial, which could last another month and help determine the outcome of next November's general election. Even before the trial opened, Scott claimed that the case against him had been launched to deny him victory against two others in his March 18 primary bid for the GOP's nomination for the Senate seat now held by Democrat Adlai Stevenson, who is not seeking reelection.

The Scott trial is also the first major prosecution of a prominent politician undertaken by U.S. attorney Thomas P. Sullivan, a Democrat appointed by President Carter. One of his immediate predecessors, Republican James Thompson, catapulted himself into the governor's mansion in Springfield through his much-publicized prosecution of prominent Democrats, including the late governor Otto Kerner and assorted cronies of Chicago's late mayor, Richard Daley.

A parade of witnesses in the trial have told of giving Scott cash gifts or loans totaling thousands of dollars, none of them ever repaid or receipted. One attorney, testifying about a payment to Scott of $2,500, ostensibly as a political campaign contribution, remarked: "There was noting unusual about it. It happened all the time."

The prosecutors have introduced evidence which they claim proves Scott billed both the state and a travel agency he owned with his first wife for airline tickets to Hawaii and Pago Pago. They have alleged that he spent some 300 days out of the country during the years at issue in the case including seven trips to Hawaii in seven straight months. All this extracurricular travel, they say, came while Scott was earning less than $50,000 a year as a public servant.

Scott's defense counsel, William A. Barnett, has told the jury that the evidence the government has introduced against the attorney general is "fictional." But some of Barnett's courtroom tactics and those of cocounsel Vincent Bugliosi, who as a California district attorney prosecuted Charles Manson in the Tate-LaBianca murder case, apparently have backfired.

In one encounter last week Barnett tried to interrupt the prosecution, arguing that he could prove his client paid for a trip the government contends Scott billed to the state.

"He paid for that," Barnett yelled, pulling a bill from his sheaf of evidence.

After a moment's perusal of the document, however, Sullivan was able to show jurors how the voucher was actually for payment of a trip made two years earlier than the date in question -- and to another locaton.

On another occasion, Bugliosi tried to keep from the jurors a piece of documentary evidence certifying a Scott claim that the attorney general spent a substantial part of his time working "directly" as a travel agent even though he was in public office at the time.

"The only relevance the document has," Bugliosi told Judge John Powers Crowley in a remarkable admission, "is to show that Mr. Scott is a liar."

"No it doesn't," the judge responded. "It goes further than that," he said, allowing the government to present the letter.

The investigation of the state's chief legal officer was triggered by disclosures by Scott's first wife of the existence of the cash-laden deposit boxes during divorce court proceedings.

Scott maintained that the money was ment for campaign purposes, and not personal expenses. But prosecutors now hope to show that Scott could not have lived as well as he has over the years without comingling political and personal funds.

To strenghten their contention, they have put Scott's tax accountant on the stand to testify that he first learned of the safe deposit cash while listening to a news broadcast disclosing it in 1977.

The accountant, Robert Johnson, conceded that he "expected to be advised" of campaign funds not deposited in accounts under his supervision.

The strain of the trial on Scott has also become more visible. On one occasion, Crowley admonished the defendant after he had interrupted the judge during a courtroom argument.

And Scott has made personal attacks on his prosecutors, asking one of them in a hallway encounter:

"How's your father? Is he still in the abortion business?"

The man's father, a gynecologist, is part-owner of an abortion clinic.