Can the police search your cellphone without a warrant?

FORTUNE — Say you’re arrested for possessing a marijuana cigarette in a state where that’s still illegal. Can the arresting officer, without a warrant, riffle through your Apple (AAPL) iPhone or Google (GOOG) Android with impunity, inspecting, say, 16 gigabytes worth of emails, text messages, contacts, calendars, photos, videos, and GPS records of your comings-and-goings?

That’s the bottom-line question permeating two cases being heard by the U.S. Supreme Court on Tuesday — one involving the prosecution of a California man for a gang-related shooting and the other, a federal case against a Boston man for selling crack cocaine.

Since 2011, the California Supreme Court has greenlighted broad warrantless cellphone searches “incident to an arrest,” while a split panel of the U.S. Court of Appeals for the First Circuit — which hears federal cases from Maine, Massachusetts, Puerto Rico, and Rhode Island — categorically forbade such searches last May. The Court will apparently be resolving this conflict before its current term ends in late June.

Since the country’s founding, an arresting officer has traditionally been permitted to search and inspect, without a warrant, anything found on the arrestee’s person, even if that meant opening closed envelopes and containers, and flipping through the accused’s notebooks, datebooks or wallets — all containing private information that does not differ in kind from what is now stored on cellphones.

But attorneys for the two defendants in these two cases — backed by numerous constitutional and civil liberties groups, ranging from the progressive American Civil Liberties Union to the libertarian Cato Institute — argue that the traditional rule needs to be revised in light of the massive storage capacity of modern digital devices and the extraordinary sensitivity of the private data citizens now routinely store there.

“Technology now makes it possible for individuals to carry huge quantities of information with them every day,” write Yale Law School professor Eugene Fidell and private attorney Andrew Pincus in a brief they’ve co-authored by the Center for Democracy and Technology and the Electronic Frontier Foundation. “Prior to the advent of digital technology, this information would have been stored in the drawers and file cabinets of people’s homes,” they write. “Law enforcement officers would have been required to obtain a warrant in order to search such materials.” (Pincus is a partner with the Mayer Brown law firm.)

A 16 gigabyte phone — the smallest available storage capacity for the Apple iPhone 5 — “can store 800 million words of text — well over a football field’s length of books or sixteen flat-bed truckloads of paper,” Fidell and Pincus write. (The phone also comes in 32 GB and 64 GB versions, while other manufacturers offer up to 128 GM of memory, they note.)

In light of this new reality, argue Doug Kendall and Elizabeth Wydra of the Constitutional Accountability Center in their amicus brief, today’s warrantless cellphone searches incident to arrest closely resemble the reviled “general warrants” and “writs of assistance” that British authorities carried out during colonial times — the precise evil the Framers of the Constitution sought to bar by enacting the Fourth Amendment. “These warrants and writs lacked any specificity about the people or items to be searched and were not predicated on any individualized suspicion,” they write. To prevent such searches, the Fourth Amendment explicitly “required not only that all searches be reasonable, but also that all warrants ‘particularly describ[e] the place to be searched, and the persons or things to be seized.’”

(The Fourth Amendment reads: “The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no Warrants shall issue, but upon probable cause, supported by oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized.”)

But law enforcement authorities urge preservation of the traditional rule, which gives arresting officers an unqualified right to inspect items found on the arrestee’s person. This historical rule “rests primarily on the ‘reduced expectations of privacy caused by the arrest,’” according to U.S. Solicitor General Donald Verrilli, Jr. — who represents the interests of the United States as a party in the federal case, United States v. Wurie, and as a so-called friend-of-the-court in the California case, Riley v. California.

“The traditional rule also comports with the realities of police work,” Verrilli argues, “in which officers cannot reasonably be expected to undertake an item-by-item legal analysis during arrests …In today’s world, cell phones are particularly likely to contain evidence of unlawful activity and to help law-enforcement officers identify suspects they have apprehended.”

“And unlike other containers,” Verrilli continues, “their contents can be destroyed or concealed after the suspect is taken into custody, making it impossible or impracticable for the police ever to retrieve critical evidence.” Here he is referring in part to the threat that a confederate of the arrested individual could use “remote wiping” technologies — designed for people whose phones are stolen — to destroy incriminating data saved on the phone.

At a more basic level, an immediate search may simply be the officer’s only opportunity to circumvent password protections, Verrilli argues. “When an officer finds an unlocked cell phone at the scene of an arrest, searching it immediately may be her only chance to retrieve and preserve essential evidence,” he writes. “[The defendants’] proposed solutions to that serious problem — such as equipping every officer with unwieldy forensic devices that cost several thousand dollars each — are entirely unrealistic.”

In the California case, David Riley was pulled over in San Diego in August 2009 for expired license plate tags. When the arresting officer discovered that Riley’s license was suspended, he started to impound the car, requiring him to inventory its contents. In the course of doing that, he found two guns strapped under the hood. He then placed Riley under arrest for possessing concealed weapons.

While conducting a search incident to the arrest, the officer took a cellphone, a Samsung SPH-M800 Instinct, from Riley’s pants pocket. Without a warrant he began scrolling through Riley’s contacts and text messages. He saw that words and names that would ordinarily start with a “K” were spelled with a “CK,” which he recognized as a possible gang-related reference to “Crip Killers,” i.e., “Bloods.”

Two hours later, during a second warrantless search of the phone at the police station, a second officer found more gang-related evidence, including stills of Riley and others making gang related hand signals, and videos of “street boxing” — a gang initiation rite — at which Riley could be heard saying things like, “Get him, Blood.” More important, there were photos of Riley and two associates with a red Oldsmobile in the background, a car believed to have served as a getaway car to a gang-related shooting two weeks earlier. Ballistics tests on the guns found under Riley’s hood later linked them to the shooting. Riley was charged with, and convicted of, attempted murder, and the fact the shooting had allegedly further gang-related activity — as proven by videos and stills found on his cellphone — was used to enhance his sentence from a seven-year maximum to a mandatory minimum term of 15 years to life.

The federal case, concerning the September 2007 arrest of Brima Wurie, involved a more limited search of a phone, which is identified in the record only as a “Verizon LG.” Wurie was arrested after he was observed apparently selling drugs out of his car. Using clues obtained from a search of Wurie’s phone — mainly the fact that his phone log showed frequent calls from a number labeled “my house,” together with a photo of Wurie’s companion, which served as his phone’s screen “wallpaper” — the officers tracked down Wurie’s residence, which he had otherwise refused to reveal to the officers. After getting a search warrant for that residence, officers seized crack cocaine, cash, a firearm, and ammunition.

Cellphones are the only devices directly involved in the two cases being argued Tuesday, and since the arrests occurred back in 2007 and 2009, the phones are not particularly advanced compared to what are prevalent today.

Nevertheless, all parties recognize that the cases will shed light on seizures of any device that can be found on someone’s person, including tablets, laptops, thumbdrives, and, in the future, Google Glass, say, a smartwatch, or any other wearable computer device.

Although law enforcement would understandably like to keep the historical rule inviolate, the advance of technology seems to have rendered that option untenable.